Don't start retreat time if hog has lost control in the meantime
authorWuzzy <Wuzzy2@mail.ru>
Mon, 03 Sep 2018 01:09:14 +0200
changeset 13747 52959f686082
parent 13746 1a26c472f5ef
child 13748 d09366ca4d7b
Don't start retreat time if hog has lost control in the meantime
ChangeLog.txt
hedgewars/uGearsHedgehog.pas
--- a/ChangeLog.txt	Mon Sep 03 00:53:44 2018 +0200
+++ b/ChangeLog.txt	Mon Sep 03 01:09:14 2018 +0200
@@ -33,6 +33,7 @@
  * Fix Sudden Death starting in the second turn of a round rather than the first
  * Prevent voices from being spoken directly before a victory voice
  * Fix damage not being displayed if hog drowns in water with 100% opacity (like in Compost theme)
+ * Fix retreat timer appearing after using baseball bat or whip and immediately taking damage
 
 Frontend:
  + Add setting to disable audio dampening when losing window focus
--- a/hedgewars/uGearsHedgehog.pas	Mon Sep 03 00:53:44 2018 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Mon Sep 03 01:09:14 2018 +0200
@@ -638,10 +638,13 @@
                 begin
                 if TagTurnTimeLeft = 0 then
                     TagTurnTimeLeft:= TurnTimeLeft;
-                if (CurAmmoGear <> nil) and (CurAmmoGear^.State and gstSubmersible <> 0) and CheckCoordInWater(hwRound(CurAmmoGear^.X), hwRound(CurAmmoGear^.Y)) then
-                     TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 25
-                else TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
-                IsGetAwayTime := true;
+                if (HHGear^.State and gstHHDriven) <> 0 then
+                    begin
+                    if (CurAmmoGear <> nil) and (CurAmmoGear^.State and gstSubmersible <> 0) and CheckCoordInWater(hwRound(CurAmmoGear^.X), hwRound(CurAmmoGear^.Y)) then
+                         TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 25
+                    else TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
+                    IsGetAwayTime := true;
+                    end;
                 end;
             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (HHGear <> nil) then
                 HHGear^.State:= HHGear^.State or gstAttacked;