# HG changeset patch # User unc0rr # Date 1183474053 0 # Node ID ac1e32b538fdd0179b13e61d7ab104f3cbb4b66f # Parent b81a055f2d06b7b16d22868d304d59246211d8bc Fix regression introduced by previous commit diff -r b81a055f2d06 -r ac1e32b538fd hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Mon Jul 02 21:33:21 2007 +0000 +++ b/hedgewars/uTeams.pas Tue Jul 03 14:47:33 2007 +0000 @@ -85,12 +85,21 @@ function CheckForWin: boolean; var team, AliveTeam: PTeam; s: shortstring; + t, AliveCount: LongInt; begin -if TeamsCount >= 2 then exit(false); +AliveCount:= 0; +for t:= 0 to Pred(TeamsCount) do + if TeamsArray[t]^.TeamHealth > 0 then + begin + inc(AliveCount); + AliveTeam:= TeamsArray[t] + end; + +if AliveCount >= 2 then exit(false); CheckForWin:= true; TurnTimeLeft:= 0; -if TeamsCount = 0 then +if AliveCount = 0 then begin // draw AddCaption(trmsg[sidDraw], $FFFFFF, capgrpGameState); SendStat(siGameResult, trmsg[sidDraw]);