# HG changeset patch # User nemo # Date 1289169655 18000 # Node ID 31e77dcf18fe0e7117e217c742c7b8a16a64e983 # Parent 85ff4cce27c69ca7329cb3dfef68f06ec97fc3b2 better end of turn in infinite attack mode. NEEDS TESTING. diff -r 85ff4cce27c6 -r 31e77dcf18fe hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Nov 07 17:03:10 2010 -0500 +++ b/hedgewars/uGears.pas Sun Nov 07 17:40:55 2010 -0500 @@ -724,7 +724,7 @@ stAfterDelay, stChWin, stWater, stChWin2, stHealth, stSpawn, stNTurn) = stDelay; var Gear, t: PGear; - i: LongInt; + i, AliveCount: LongInt; s: shortstring; begin PrvInactive:= AllInactive; @@ -879,7 +879,15 @@ begin SweepDirty; CheckNoDamage; - CheckForWin + AliveCount:= 0; // shorter version of check for win to allow typical step activity to proceed + for i:= 0 to Pred(ClansCount) do + if ClansArray[i]^.ClanHealth > 0 then inc(AliveCount); + if (AliveCount <= 1) and ((GameFlags and gfOneClanMode) = 0) then + begin + step:= stChDmg; + GameFlags:= GameFlags and not gfInfAttack; + TurnTimeLeft:= 0 + end end end end;