check for turn over (infinite attack)
authornemo
Mon, 05 Sep 2011 15:05:46 -0400
changeset 5786 ffe2401e287f
parent 5785 45b85a04bb1e
child 5787 f2caf41f2984
check for turn over (infinite attack)
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Mon Sep 05 21:45:28 2011 +0400
+++ b/hedgewars/GSHandlers.inc	Mon Sep 05 15:05:46 2011 -0400
@@ -1127,7 +1127,7 @@
     HHGear := Gear^.Hedgehog^.Gear;
     dec(Gear^.Timer);
     if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then dec(TurnTimeLeft);
-    if (Gear^.Timer = 0)or((Gear^.Message and gmDestroy) <> 0)or((HHGear^.State and gstHHDriven) =
+    if (TurnTimeLeft = 0) or (Gear^.Timer = 0)or((Gear^.Message and gmDestroy) <> 0)or((HHGear^.State and gstHHDriven) =
        0) then
         begin
         StopSound(Gear^.SoundChannel);
@@ -1305,7 +1305,7 @@
         Gear^.dX, Gear^.dY,
         cHHRadius * 5, cHHRadius * 2 + 7);
 
-    if (Gear^.Timer = 0) or ((HHGear^.Message and gmAttack) <> 0) then
+    if (TurnTimeLeft = 0) or (Gear^.Timer = 0) or ((HHGear^.Message and gmAttack) <> 0) then
         begin
         HHGear^.Message := 0;
         HHGear^.State := HHGear^.State and (not gstNotKickable);