hedgewars/uTeams.pas
changeset 6211 ee9465c0ea82
parent 6131 4e8816cf9459
child 6450 14224c9b4594
--- a/hedgewars/uTeams.pas	Wed Oct 26 01:17:44 2011 +0200
+++ b/hedgewars/uTeams.pas	Wed Oct 26 01:50:08 2011 +0200
@@ -542,6 +542,23 @@
 end;
 
 
+procedure chFinish(var s:shortstring);
+var t: LongInt;
+begin
+// avoid compiler hint
+s:= s;
+
+t:= 0;
+while (t < cMaxTeams) and (TeamsArray[t] <> nil) do
+    begin
+    TeamsArray[t]^.hasGone:= true;
+    inc(t);
+    end;
+
+AddChatString('** Good-bye!');
+RecountAllTeamsHealth();
+end;
+
 procedure initModule;
 begin
     RegisterVariable('addhh', vtCommand, @chAddHH, false);
@@ -549,6 +566,7 @@
     RegisterVariable('hhcoords', vtCommand, @chSetHHCoords, false);
     RegisterVariable('bind', vtCommand, @chBind, true );
     RegisterVariable('teamgone', vtCommand, @chTeamGone, true );
+    RegisterVariable('finish', vtCommand, @chFinish, true ); // all teams gone
 
     CurrentTeam:= nil;
     PreviousTeam:= nil;