hedgewars/uScript.pas
changeset 6046 d681b8127523
parent 6019 8843ea756cfc
child 6088 47d1b04003d1
--- a/hedgewars/uScript.pas	Tue Sep 27 00:46:15 2011 +0200
+++ b/hedgewars/uScript.pas	Mon Sep 26 21:29:40 2011 -0400
@@ -957,8 +957,12 @@
             end
         else lua_pushinteger(L, 0)
         end
-    else LuaError('Lua: Wrong number of parameters passed to GetAmmoCount!');
-    lc_getammocount:= 0
+    else 
+        begin
+        LuaError('Lua: Wrong number of parameters passed to GetAmmoCount!');
+        lua_pushnil(L)
+        end;
+    lc_getammocount:= 1
 end;
 
 function lc_sethealth(L : Plua_State) : LongInt; Cdecl;