hedgewars/uTeams.pas
changeset 2715 0e4e0db79e2a
parent 2704 51cda17b7c3b
child 2716 b9ca1bfca24f
equal deleted inserted replaced
2714:c85ffe57d971 2715:0e4e0db79e2a
   112 
   112 
   113 implementation
   113 implementation
   114 uses uMisc, uWorld, uAI, uLocale, uConsole, uAmmos, uChat;
   114 uses uMisc, uWorld, uAI, uLocale, uConsole, uAmmos, uChat;
   115 const MaxTeamHealth: LongInt = 0;
   115 const MaxTeamHealth: LongInt = 0;
   116 
   116 
   117 procedure FreeTeamsList; forward;
       
   118 
       
   119 function CheckForWin: boolean;
   117 function CheckForWin: boolean;
   120 var AliveClan: PClan;
   118 var AliveClan: PClan;
   121     s: shortstring;
   119     s: shortstring;
   122     t, AliveCount, i, j: LongInt;
   120     t, AliveCount, i, j: LongInt;
   123 begin
   121 begin
   290 
   288 
   291 CurrentTeam:= team;
   289 CurrentTeam:= team;
   292 AddTeam:= team;
   290 AddTeam:= team;
   293 end;
   291 end;
   294 
   292 
   295 procedure FreeTeamsList;
       
   296 var t: LongInt;
       
   297 begin
       
   298 for t:= 0 to Pred(TeamsCount) do Dispose(TeamsArray[t]);
       
   299 TeamsCount:= 0
       
   300 end;
       
   301 
       
   302 procedure RecountAllTeamsHealth;
   293 procedure RecountAllTeamsHealth;
   303 var t: LongInt;
   294 var t: LongInt;
   304 begin
   295 begin
   305 for t:= 0 to Pred(TeamsCount) do
   296 for t:= 0 to Pred(TeamsCount) do
   306     RecountTeamHealth(TeamsArray[t])
   297     RecountTeamHealth(TeamsArray[t])
   413 	ClansCount:= 0;
   404 	ClansCount:= 0;
   414 	LocalClan:= 0;  // first non-bot, non-extdriven clan
   405 	LocalClan:= 0;  // first non-bot, non-extdriven clan
   415 end;
   406 end;
   416 
   407 
   417 procedure free_uTeams;
   408 procedure free_uTeams;
   418 begin
   409 var i: LongWord;
   419 	FreeTeamsList()
   410 begin
       
   411    for i:= 0 to Pred(TeamsCount) do Dispose(TeamsArray[i]);
       
   412    for i:= 0 to Pred(ClansCount) do Dispose(ClansArray[i]);
       
   413    TeamsCount:= 0;
       
   414    ClansCount:= 0
   420 end;
   415 end;
   421 
   416 
   422 end.
   417 end.