hedgewars/uScript.pas
changeset 14484 4e5280a9e782
parent 14482 4b678aad50e9
child 14489 764ba6182389
equal deleted inserted replaced
14483:35724823b0d3 14484:4e5280a9e782
  2296         ParseCommand('addteam x ' + colorStr + ' ' + lua_tostring(L, 1), true, true);
  2296         ParseCommand('addteam x ' + colorStr + ' ' + lua_tostring(L, 1), true, true);
  2297         ParseCommand('grave ' + lua_tostring(L, 3), true, true);
  2297         ParseCommand('grave ' + lua_tostring(L, 3), true, true);
  2298         ParseCommand('fort ' + lua_tostring(L, 4), true, true);
  2298         ParseCommand('fort ' + lua_tostring(L, 4), true, true);
  2299         ParseCommand('voicepack ' + lua_tostring(L, 5), true, true);
  2299         ParseCommand('voicepack ' + lua_tostring(L, 5), true, true);
  2300         if (np = 6) then ParseCommand('flag ' + lua_tostring(L, 6), true, true);
  2300         if (np = 6) then ParseCommand('flag ' + lua_tostring(L, 6), true, true);
  2301         CurrentTeam^.Binds:= DefaultBinds
  2301         CurrentTeam^.Binds:= DefaultBinds;
  2302         // fails on x64
  2302         // push team index
  2303         //lua_pushnumber(L, LongInt(CurrentTeam));
  2303         lua_pushnumber(L, TeamsCount - 1);
  2304         end;
  2304         end
  2305     //else
  2305     else
  2306         //lua_pushnil(L)
  2306         lua_pushnil(L);
  2307     lc_addteam:= 0;//1;
  2307     lc_addteam:= 1;
  2308 end;
  2308 end;
  2309 
  2309 
  2310 function lc_addmissionteam(L : Plua_State) : LongInt; Cdecl;
  2310 function lc_addmissionteam(L : Plua_State) : LongInt; Cdecl;
  2311 var colorArg: Int64;
  2311 var colorArg: Int64;
  2312     colorStr: shortstring;
  2312     colorStr: shortstring;
  2337         ParseCommand('addteam x ' + colorStr + ' ' + MissionTeam^.TeamName, true, true);
  2337         ParseCommand('addteam x ' + colorStr + ' ' + MissionTeam^.TeamName, true, true);
  2338         ParseCommand('grave ' + MissionTeam^.GraveName, true, true);
  2338         ParseCommand('grave ' + MissionTeam^.GraveName, true, true);
  2339         ParseCommand('fort ' + MissionTeam^.FortName, true, true);
  2339         ParseCommand('fort ' + MissionTeam^.FortName, true, true);
  2340         ParseCommand('voicepack ' + MissionTeam^.Voicepack^.name, true, true);
  2340         ParseCommand('voicepack ' + MissionTeam^.Voicepack^.name, true, true);
  2341         ParseCommand('flag ' + MissionTeam^.Flag, true, true);
  2341         ParseCommand('flag ' + MissionTeam^.Flag, true, true);
  2342         CurrentTeam^.Binds:= DefaultBinds
  2342         CurrentTeam^.Binds:= DefaultBinds;
  2343         end;
  2343         // push team index
  2344     lc_addmissionteam:= 0;
  2344         lua_pushnumber(L, TeamsCount - 1);
       
  2345         end
       
  2346     else
       
  2347         lua_pushnil(L);
       
  2348     lc_addmissionteam:= 1;
  2345 end;
  2349 end;
  2346 
  2350 
  2347 function lc_setteamlabel(L : Plua_State) : LongInt; Cdecl;
  2351 function lc_setteamlabel(L : Plua_State) : LongInt; Cdecl;
  2348 var teamValue: ansistring;
  2352 var teamValue: ansistring;
  2349     i, n: LongInt;
  2353     i, n: LongInt;