hedgewars/uTeams.pas
changeset 17 a6bed8d31444
parent 13 7a5db822fd3f
child 32 78bff13b11c0
equal deleted inserted replaced
16:b6f4b413dd41 17:a6bed8d31444
   138 CurrentTeam.CurrHedgehog:= i;
   138 CurrentTeam.CurrHedgehog:= i;
   139 end;
   139 end;
   140 
   140 
   141 function AddTeam: PTeam;
   141 function AddTeam: PTeam;
   142 begin
   142 begin
   143 try
   143 New(Result);
   144    New(Result);
   144 TryDo(Result <> nil, 'AddTean: Result = nil', true);
   145 except Result:= nil; OutError(errmsgDynamicVar, true) end;
       
   146 FillChar(Result^, sizeof(TTeam), 0);
   145 FillChar(Result^, sizeof(TTeam), 0);
   147 Result.AttackBar:= 1;
   146 Result.AttackBar:= 1;
   148 if TeamsList = nil then TeamsList:= Result
   147 if TeamsList = nil then TeamsList:= Result
   149                    else begin
   148                    else begin
   150                         Result.Next:= TeamsList;
   149                         Result.Next:= TeamsList;
   160 TeamsList:= nil;
   159 TeamsList:= nil;
   161 while tt<>nil do
   160 while tt<>nil do
   162       begin
   161       begin
   163       t:= tt;
   162       t:= tt;
   164       tt:= tt.Next;
   163       tt:= tt.Next;
   165       try
       
   166       Dispose(t)
   164       Dispose(t)
   167       except OutError(errmsgDynamicVar) end;
       
   168       end;
   165       end;
   169 end;
   166 end;
   170 
   167 
   171 procedure FillAmmoGroup(Ammo: PHHAmmo);
   168 procedure FillAmmoGroup(Ammo: PHHAmmo);
   172 var mi: array[0..cMaxSlotIndex] of byte;
   169 var mi: array[0..cMaxSlotIndex] of byte;