hedgewars/uScript.pas
changeset 6924 57b66ee3bff3
parent 6828 6a5d33bff0b0
child 6982 8d41d22a291d
equal deleted inserted replaced
6923:d2405a6a86f5 6924:57b66ee3bff3
  1021         gear:= GearByUID(lua_tointeger(L, 1));
  1021         gear:= GearByUID(lua_tointeger(L, 1));
  1022         if (gear <> nil) and (gear^.Hedgehog <> nil) then
  1022         if (gear <> nil) and (gear^.Hedgehog <> nil) then
  1023             if lua_gettop(L) = 2 then
  1023             if lua_gettop(L) = 2 then
  1024                 AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)))
  1024                 AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)))
  1025             else
  1025             else
  1026                 AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)), lua_tointeger(L, 3))
  1026                 SetAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)), lua_tointeger(L, 3))
  1027         end
  1027         end
  1028     else LuaError('Lua: Wrong number of parameters passed to AddAmmo!');
  1028     else LuaError('Lua: Wrong number of parameters passed to AddAmmo!');
  1029     lc_addammo:= 0
  1029     lc_addammo:= 0
  1030 end;
  1030 end;
  1031 
  1031