hedgewars/uTeams.pas
changeset 4881 35e6269227b6
parent 4514 c62e6e522849
child 4889 f71e30eb1d37
equal deleted inserted replaced
4880:07e9849c6a70 4881:35e6269227b6
   527     LocalAmmo:= -1;
   527     LocalAmmo:= -1;
   528     GameOver:= false
   528     GameOver:= false
   529 end;
   529 end;
   530 
   530 
   531 procedure freeModule;
   531 procedure freeModule;
   532 var i: LongWord;
   532 var i, h: LongWord;
   533 begin
   533 begin
   534    if TeamsCount > 0 then
   534    if TeamsCount > 0 then
   535      begin
   535      begin
   536      for i:= 0 to Pred(TeamsCount) do Dispose(TeamsArray[i]);
   536      for i:= 0 to Pred(TeamsCount) do
       
   537         begin
       
   538             for h:= 0 to cMaxHHIndex do
       
   539                 if TeamsArray[i]^.Hedgehogs[h].GearHidden <> nil then
       
   540                     Dispose(TeamsArray[i]^.Hedgehogs[h].GearHidden);
       
   541             Dispose(TeamsArray[i]);
       
   542         end;
   537      for i:= 0 to Pred(ClansCount) do Dispose(ClansArray[i]);
   543      for i:= 0 to Pred(ClansCount) do Dispose(ClansArray[i]);
   538      end;
   544      end;
   539    TeamsCount:= 0;
   545    TeamsCount:= 0;
   540    ClansCount:= 0
   546    ClansCount:= 0
   541 end;
   547 end;