return visual gear in hogsay
authornemo
Tue, 09 Aug 2011 21:18:12 -0400
changeset 5529 9a47cff3910a
parent 5528 c539e5c81870
child 5531 52f4a5d9a222
return visual gear in hogsay
hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Mon Aug 08 23:57:04 2011 -0400
+++ b/hedgewars/uScript.pas	Tue Aug 09 21:18:12 2011 -0400
@@ -861,11 +861,13 @@
                vgear^.Hedgehog:= gear^.Hedgehog;
                vgear^.FrameTicks:= lua_tointeger(L, 3);
                if (vgear^.FrameTicks < 1) or (vgear^.FrameTicks > 3) then vgear^.FrameTicks:= 1;
-               end;
+               lua_pushinteger(L, vgear^.Uid)
+               end
             end
+            else lua_pushnil(L)
         end
     else LuaError('Lua: Wrong number of parameters passed to HogSay!');
-    lc_hogsay:= 0
+    lc_hogsay:= 1
 end;
 
 function lc_switchhog(L : Plua_State) : LongInt; Cdecl;