hedgewars/uScript.pas
changeset 11196 f4cf2cdea8e5
parent 11179 98d14636c371
child 11251 66796cd627d8
equal deleted inserted replaced
11193:283b6e6cf7ea 11196:f4cf2cdea8e5
   626 begin
   626 begin
   627     if CheckLuaParamCount(L, 4,'SpawnFakeHealthCrate', 'x, y, explode, poison') then
   627     if CheckLuaParamCount(L, 4,'SpawnFakeHealthCrate', 'x, y, explode, poison') then
   628         begin
   628         begin
   629         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
   629         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
   630         HealthCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
   630         HealthCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
   631         lua_pushinteger(L, gear^.uid);
   631         if gear <> nil then
       
   632              lua_pushinteger(L, gear^.uid)
       
   633         else lua_pushnil(L)
   632         end
   634         end
   633     else
   635     else
   634         lua_pushnil(L);
   636         lua_pushnil(L);
   635     lc_spawnfakehealthcrate := 1;
   637     lc_spawnfakehealthcrate := 1;
   636 end;
   638 end;