hedgewars/uScript.pas
changeset 7339 5984b749ad9b
parent 7337 c224cd2d32f3
child 7374 514138949c76
child 7401 4c3ec3dca0c7
equal deleted inserted replaced
7337:c224cd2d32f3 7339:5984b749ad9b
   339         LuaError('Lua: Wrong number of parameters passed to SpawnAmmoCrate!');
   339         LuaError('Lua: Wrong number of parameters passed to SpawnAmmoCrate!');
   340         lua_pushnil(L);
   340         lua_pushnil(L);
   341         end
   341         end
   342     else
   342     else
   343         begin
   343         begin
   344         if (lua_gettop(L) <> 3) then 
   344         if (lua_gettop(L) = 3) then 
   345              gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), 0)
   345              gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), 0)
   346         else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), lua_tointeger(L, 4));
   346         else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), lua_tointeger(L, 4));
   347         if gear <> nil then
   347         if gear <> nil then
   348             lua_pushinteger(L, gear^.uid)
   348             lua_pushinteger(L, gear^.uid)
   349         else
   349         else
   360         LuaError('Lua: Wrong number of parameters passed to SpawnUtilityCrate!');
   360         LuaError('Lua: Wrong number of parameters passed to SpawnUtilityCrate!');
   361         lua_pushnil(L);
   361         lua_pushnil(L);
   362         end
   362         end
   363     else
   363     else
   364         begin
   364         begin
   365         if (lua_gettop(L) <> 3) then
   365         if (lua_gettop(L) = 3) then
   366              gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), 0)
   366              gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), 0)
   367         else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), lua_tointeger(L, 4));
   367         else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), lua_tointeger(L, 4));
   368         if gear <> nil then
   368         if gear <> nil then
   369             lua_pushinteger(L, gear^.uid)
   369             lua_pushinteger(L, gear^.uid)
   370         else
   370         else