Fix engine freeze when one of the teams is killed before its first turn, number of hedgehogs in that team < 8, and game still goes on
--- a/hedgewars/uTeams.pas Fri Jan 16 18:40:52 2009 +0000
+++ b/hedgewars/uTeams.pas Fri Jan 16 23:27:25 2009 +0000
@@ -185,7 +185,7 @@
CurrentTeam:= Teams[CurrTeam];
with CurrentTeam^ do
begin
- PrevHH:= CurrHedgehog;
+ PrevHH:= CurrHedgehog mod HedgehogsNumber; // prevent infinite loop when CurrHedgehog = 7, but HedgehogsNumber < 8 (team is destroyed before its first turn
repeat
CurrHedgehog:= Succ(CurrHedgehog) mod HedgehogsNumber;
until (Hedgehogs[CurrHedgehog].Gear <> nil) or (CurrHedgehog = PrevHH)