hedgewars/uTeams.pas
changeset 8346 3443e0de2c9d
parent 8145 6408c0ba4ba1
child 8349 a1dbe148f10f
equal deleted inserted replaced
8344:3d18f7f71d65 8346:3443e0de2c9d
   328 ScriptCall('onNewTurn');
   328 ScriptCall('onNewTurn');
   329 end;
   329 end;
   330 
   330 
   331 function AddTeam(TeamColor: Longword): PTeam;
   331 function AddTeam(TeamColor: Longword): PTeam;
   332 var team: PTeam;
   332 var team: PTeam;
   333     c: LongInt;
   333     c, t: LongInt;
   334 begin
   334 begin
   335 TryDo(TeamsCount < cMaxTeams, 'Too many teams', true);
   335 TryDo(TeamsCount < cMaxTeams, 'Too many teams', true);
   336 New(team);
   336 New(team);
   337 TryDo(team <> nil, 'AddTeam: team = nil', true);
   337 TryDo(team <> nil, 'AddTeam: team = nil', true);
   338 FillChar(team^, sizeof(TTeam), 0);
   338 FillChar(team^, sizeof(TTeam), 0);
   340 team^.CurrHedgehog:= 0;
   340 team^.CurrHedgehog:= 0;
   341 team^.Flag:= 'hedgewars';
   341 team^.Flag:= 'hedgewars';
   342 
   342 
   343 TeamsArray[TeamsCount]:= team;
   343 TeamsArray[TeamsCount]:= team;
   344 inc(TeamsCount);
   344 inc(TeamsCount);
       
   345 
       
   346 for t:= 0 to cKbdMaxIndex do
       
   347     team^.Binds[t]:= '';
   345 
   348 
   346 c:= Pred(ClansCount);
   349 c:= Pred(ClansCount);
   347 while (c >= 0) and (ClansArray[c]^.Color <> TeamColor) do dec(c);
   350 while (c >= 0) and (ClansArray[c]^.Color <> TeamColor) do dec(c);
   348 if c < 0 then
   351 if c < 0 then
   349     begin
   352     begin