hedgewars/uScript.pas
changeset 3271 0405e07ca44b
parent 3209 4533c6e02240
child 3337 75e7455c69ed
equal deleted inserted replaced
3270:9bd8fb1707b9 3271:0405e07ca44b
   421         end;
   421         end;
   422     lc_addteam:= 0;//1;
   422     lc_addteam:= 0;//1;
   423 end;
   423 end;
   424 
   424 
   425 function lc_addhog(L : Plua_State) : LongInt; Cdecl;
   425 function lc_addhog(L : Plua_State) : LongInt; Cdecl;
       
   426 var temp: ShortString;
   426 begin
   427 begin
   427     if lua_gettop(L) <> 4 then
   428     if lua_gettop(L) <> 4 then
   428         begin
   429         begin
   429         WriteLnToConsole('LUA: Wrong number of parameters passed to AddHog!');
   430         WriteLnToConsole('LUA: Wrong number of parameters passed to AddHog!');
   430         lua_pushnil(L)
   431         lua_pushnil(L)
   431         end
   432         end
   432     else
   433     else
   433         begin
   434         begin
       
   435         temp:= lua_tostring(L, 4);
   434         ParseCommand('addhh ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 3) + ' ' + lua_tostring(L, 1), true);
   436         ParseCommand('addhh ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 3) + ' ' + lua_tostring(L, 1), true);
   435         ParseCommand('hat ' + lua_tostring(L, 4), true);
   437         ParseCommand('hat ' + temp, true);
   436         lua_pushinteger(L, CurrentHedgehog^.Gear^.uid);
   438         lua_pushinteger(L, CurrentHedgehog^.Gear^.uid);
   437         end;
   439         end;
   438     lc_addhog:= 1;
   440     lc_addhog:= 1;
   439 end;
   441 end;
   440 
   442