hedgewars/uScript.pas
changeset 3730 aecea9aa53dc
parent 3724 b8678667e7dc
child 3734 304a83637eb4
--- a/hedgewars/uScript.pas	Fri Aug 06 11:53:28 2010 +0200
+++ b/hedgewars/uScript.pas	Sat Aug 07 01:45:31 2010 +0200
@@ -117,6 +117,22 @@
     lc_hidemission:= 0;
 end;
 
+function lc_spawnhealthcrate(L: Plua_State) : LongInt; Cdecl;
+var x, y: LongInt;
+begin
+    if lua_gettop(L) <> 2 then begin
+        LuaError('Lua: Wrong number of parameters passed to SpawnHealthCrate!');
+        lua_pushnil(L);
+    end
+    else begin
+        x:= lua_tointeger(L, 1);
+        y:= lua_tointeger(L, 2);
+        cCaseFactor := 0;
+        SpawnHealthCrate(x, y);
+    end;
+    lc_spawnhealthCrate := 1;
+end;
+
 function lc_addgear(L : Plua_State) : LongInt; Cdecl;
 var gear : PGear;
     x, y, s, t: LongInt;
@@ -862,6 +878,7 @@
 
 // register functions
 lua_register(luaState, 'AddGear', @lc_addgear);
+lua_register(luaState, 'SpawnHealthCrate', @lc_spawnhealthcrate);
 lua_register(luaState, 'WriteLnToConsole', @lc_writelntoconsole);
 lua_register(luaState, 'GetGearType', @lc_getgeartype);
 lua_register(luaState, 'EndGame', @lc_endgame);