hedgewars/uTeams.pas
changeset 6211 ee9465c0ea82
parent 6131 4e8816cf9459
child 6450 14224c9b4594
equal deleted inserted replaced
6210:923c8414e3af 6211:ee9465c0ea82
   540 
   540 
   541 RecountTeamHealth(TeamsArray[t])
   541 RecountTeamHealth(TeamsArray[t])
   542 end;
   542 end;
   543 
   543 
   544 
   544 
       
   545 procedure chFinish(var s:shortstring);
       
   546 var t: LongInt;
       
   547 begin
       
   548 // avoid compiler hint
       
   549 s:= s;
       
   550 
       
   551 t:= 0;
       
   552 while (t < cMaxTeams) and (TeamsArray[t] <> nil) do
       
   553     begin
       
   554     TeamsArray[t]^.hasGone:= true;
       
   555     inc(t);
       
   556     end;
       
   557 
       
   558 AddChatString('** Good-bye!');
       
   559 RecountAllTeamsHealth();
       
   560 end;
       
   561 
   545 procedure initModule;
   562 procedure initModule;
   546 begin
   563 begin
   547     RegisterVariable('addhh', vtCommand, @chAddHH, false);
   564     RegisterVariable('addhh', vtCommand, @chAddHH, false);
   548     RegisterVariable('addteam', vtCommand, @chAddTeam, false);
   565     RegisterVariable('addteam', vtCommand, @chAddTeam, false);
   549     RegisterVariable('hhcoords', vtCommand, @chSetHHCoords, false);
   566     RegisterVariable('hhcoords', vtCommand, @chSetHHCoords, false);
   550     RegisterVariable('bind', vtCommand, @chBind, true );
   567     RegisterVariable('bind', vtCommand, @chBind, true );
   551     RegisterVariable('teamgone', vtCommand, @chTeamGone, true );
   568     RegisterVariable('teamgone', vtCommand, @chTeamGone, true );
       
   569     RegisterVariable('finish', vtCommand, @chFinish, true ); // all teams gone
   552 
   570 
   553     CurrentTeam:= nil;
   571     CurrentTeam:= nil;
   554     PreviousTeam:= nil;
   572     PreviousTeam:= nil;
   555     CurrentHedgehog:= nil;
   573     CurrentHedgehog:= nil;
   556     TeamsCount:= 0;
   574     TeamsCount:= 0;