# HG changeset patch # User nemo # Date 1354732268 18000 # Node ID 8cc5dc7f7ef9cdc05315091813eec8e78d24f09a # Parent 186229af4fc10069b804a45a541f86eaf66b5964 kinda treat graves like hedgehogs for the purpose of looking up hog info diff -r 186229af4fc1 -r 8cc5dc7f7ef9 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Wed Dec 05 18:12:07 2012 +0100 +++ b/hedgewars/uScript.pas Wed Dec 05 13:31:08 2012 -0500 @@ -690,7 +690,7 @@ else begin gear := GearByUID(lua_tointeger(L, 1)); - if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then + if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then lua_pushinteger(L, gear^.Hedgehog^.BotLevel) else lua_pushnil(L); @@ -723,7 +723,7 @@ else begin gear:= GearByUID(lua_tointeger(L, 1)); - if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then + if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then begin lua_pushinteger(L, gear^.Hedgehog^.Team^.Clan^.ClanIndex) end @@ -805,7 +805,7 @@ else begin gear:= GearByUID(lua_tointeger(L, 1)); - if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then + if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then begin lua_pushstring(L, str2pchar(gear^.Hedgehog^.Team^.TeamName)) end @@ -826,7 +826,7 @@ else begin gear:= GearByUID(lua_tointeger(L, 1)); - if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then + if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then begin lua_pushstring(L, str2pchar(gear^.Hedgehog^.Name)) end @@ -1648,7 +1648,7 @@ LuaError('Lua: Wrong number of parameters passed to GetHogHat!') else begin gear := GearByUID(lua_tointeger(L, 1)); - if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then + if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then lua_pushstring(L, str2pchar(gear^.Hedgehog^.Hat)) else lua_pushnil(L);