hedgewars/uScript.pas
changeset 12936 c27dd59a3ffe
parent 12935 330b6c353093
child 12937 e0da398805b6
equal deleted inserted replaced
12935:330b6c353093 12936:c27dd59a3ffe
  2047         //lua_pushnumber(L, LongInt(CurrentTeam));
  2047         //lua_pushnumber(L, LongInt(CurrentTeam));
  2048         end;
  2048         end;
  2049     //else
  2049     //else
  2050         //lua_pushnil(L)
  2050         //lua_pushnil(L)
  2051     lc_addteam:= 0;//1;
  2051     lc_addteam:= 0;//1;
       
  2052 end;
       
  2053 
       
  2054 function lc_getteamname(L : Plua_State) : LongInt; Cdecl;
       
  2055 var t: LongInt;
       
  2056 begin
       
  2057     if CheckLuaParamCount(L, 1, 'GetTeamName', 'teamIdx') then
       
  2058         begin
       
  2059         t:= Trunc(lua_tonumber(L, 1));
       
  2060         if (t < 0) or (t >= TeamsCount) then
       
  2061             lua_pushnil(L)
       
  2062         else
       
  2063             lua_pushstring(L, str2pchar(TeamsArray[t]^.TeamName));
       
  2064         end
       
  2065     else
       
  2066         lua_pushnil(L);
       
  2067     lc_getteamname:= 1;
  2052 end;
  2068 end;
  2053 
  2069 
  2054 function lc_dismissteam(L : Plua_State) : LongInt; Cdecl;
  2070 function lc_dismissteam(L : Plua_State) : LongInt; Cdecl;
  2055 var HHGear: PGear;
  2071 var HHGear: PGear;
  2056     i, h  : LongInt;
  2072     i, h  : LongInt;
  3634 lua_register(luaState, _P'SetAmmoDescriptionAppendix', @lc_setammodescriptionappendix);
  3650 lua_register(luaState, _P'SetAmmoDescriptionAppendix', @lc_setammodescriptionappendix);
  3635 lua_register(luaState, _P'AddCaption', @lc_addcaption);
  3651 lua_register(luaState, _P'AddCaption', @lc_addcaption);
  3636 lua_register(luaState, _P'SetAmmo', @lc_setammo);
  3652 lua_register(luaState, _P'SetAmmo', @lc_setammo);
  3637 lua_register(luaState, _P'SetAmmoDelay', @lc_setammodelay);
  3653 lua_register(luaState, _P'SetAmmoDelay', @lc_setammodelay);
  3638 lua_register(luaState, _P'PlaySound', @lc_playsound);
  3654 lua_register(luaState, _P'PlaySound', @lc_playsound);
       
  3655 lua_register(luaState, _P'GetTeamName', @lc_getteamname);
  3639 lua_register(luaState, _P'AddTeam', @lc_addteam);
  3656 lua_register(luaState, _P'AddTeam', @lc_addteam);
  3640 lua_register(luaState, _P'AddHog', @lc_addhog);
  3657 lua_register(luaState, _P'AddHog', @lc_addhog);
  3641 lua_register(luaState, _P'AddAmmo', @lc_addammo);
  3658 lua_register(luaState, _P'AddAmmo', @lc_addammo);
  3642 lua_register(luaState, _P'GetAmmoCount', @lc_getammocount);
  3659 lua_register(luaState, _P'GetAmmoCount', @lc_getammocount);
  3643 lua_register(luaState, _P'SetHealth', @lc_sethealth);
  3660 lua_register(luaState, _P'SetHealth', @lc_sethealth);