hedgewars/uScript.pas
changeset 5277 09beef0752ab
parent 5272 a85d331ab5bb
child 5313 5e18eaef65d0
equal deleted inserted replaced
5276:562070d3f978 5277:09beef0752ab
   848             InsertGearToList(gear);
   848             InsertGearToList(gear);
   849             end
   849             end
   850         end;
   850         end;
   851     lc_switchhog:= 0
   851     lc_switchhog:= 0
   852 end;
   852 end;
       
   853 
       
   854 {function lc_addammo(L : Plua_State) : LongInt; Cdecl;
       
   855 var gear : PGear;
       
   856 begin
       
   857 
       
   858     if lua_gettop(L) = 3 then
       
   859     begin
       
   860 	gear:= GearByUID(lua_tointeger(L, 1));
       
   861         if (gear <> nil) and (gear^.Hedgehog <> nil) then
       
   862             AddAmmoAmount(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)), lua_tointeger(L,3) );
       
   863     end else
       
   864     
       
   865     if lua_gettop(L) = 2 then
       
   866     begin
       
   867 	gear:= GearByUID(lua_tointeger(L, 1));
       
   868         if (gear <> nil) and (gear^.Hedgehog <> nil) then
       
   869             AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)));
       
   870     end else
       
   871     begin
       
   872     	LuaError('Lua: Wrong number of parameters passed to AddAmmo!');
       
   873     end;
       
   874 
       
   875     lc_addammo:= 0;
       
   876 
       
   877 end;}
   853 
   878 
   854 function lc_addammo(L : Plua_State) : LongInt; Cdecl;
   879 function lc_addammo(L : Plua_State) : LongInt; Cdecl;
   855 var gear : PGear;
   880 var gear : PGear;
   856 begin
   881 begin
   857     if (lua_gettop(L) = 3) or (lua_gettop(L) = 2) then
   882     if (lua_gettop(L) = 3) or (lua_gettop(L) = 2) then