hedgewars/uTeams.pas
changeset 13068 6369d148cfff
parent 13047 eadf8259306f
child 13140 e330feceb662
equal deleted inserted replaced
13067:64aba90811a2 13068:6369d148cfff
   384     end;
   384     end;
   385 end;
   385 end;
   386 
   386 
   387 function AddTeam(TeamColor: Longword): PTeam;
   387 function AddTeam(TeamColor: Longword): PTeam;
   388 var team: PTeam;
   388 var team: PTeam;
   389     c, t: LongInt;
   389     c: LongInt;
   390 begin
   390 begin
   391 if checkFails(TeamsCount < cMaxTeams, 'Too many teams', true) then exit(nil);
   391 if checkFails(TeamsCount < cMaxTeams, 'Too many teams', true) then exit(nil);
   392 New(team);
   392 New(team);
   393 if checkFails(team <> nil, 'AddTeam: team = nil', true) then exit(nil);
   393 if checkFails(team <> nil, 'AddTeam: team = nil', true) then exit(nil);
   394 FillChar(team^, sizeof(TTeam), 0);
   394 FillChar(team^, sizeof(TTeam), 0);
   397 team^.Flag:= 'hedgewars';
   397 team^.Flag:= 'hedgewars';
   398 
   398 
   399 TeamsArray[TeamsCount]:= team;
   399 TeamsArray[TeamsCount]:= team;
   400 inc(TeamsCount);
   400 inc(TeamsCount);
   401 
   401 
   402 for t:= 0 to cKbdMaxIndex do
   402 team^.Binds:= DefaultBinds;
   403     team^.Binds[t]:= DefaultBinds[t];
       
   404 
   403 
   405 c:= Pred(ClansCount);
   404 c:= Pred(ClansCount);
   406 while (c >= 0) and (ClansArray[c]^.Color <> TeamColor) do dec(c);
   405 while (c >= 0) and (ClansArray[c]^.Color <> TeamColor) do dec(c);
   407 if c < 0 then
   406 if c < 0 then
   408     begin
   407     begin