hedgewars/GSHandlers.inc
changeset 551 86bc0430ba17
parent 549 4278a80140a8
child 557 a7d49d5e8257
--- a/hedgewars/GSHandlers.inc	Tue Jul 03 17:03:41 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Tue Jul 03 17:06:18 2007 +0000
@@ -1198,8 +1198,8 @@
 
    th:= CurrentTeam^.CurrHedgehog;
    repeat
-     CurrentTeam^.CurrHedgehog:= Succ(CurrentTeam^.CurrHedgehog) mod (cMaxHHIndex + 1);
-   until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) or (CurrentTeam^.CurrHedgehog = th);
+     CurrentTeam^.CurrHedgehog:= Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber);
+   until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil);
 
    HHGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear;
    HHGear^.State:= State;