return nil for position if no gear
authornemo
Mon, 19 Sep 2011 14:17:33 -0400
changeset 5964 44d2dc3b438f
parent 5962 a5267091b205
child 5965 e529b28d10e9
return nil for position if no gear
hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Sun Sep 18 21:59:34 2011 +0200
+++ b/hedgewars/uScript.pas	Mon Sep 19 14:17:33 2011 -0400
@@ -1207,6 +1207,11 @@
             lua_pushinteger(L, hwRound(gear^.X));
             lua_pushinteger(L, hwRound(gear^.Y))
             end
+        else
+            begin
+            lua_pushnil(L);
+            lua_pushnil(L)
+            end;
         end;
     lc_getgearposition:= 2;
 end;