Avoid waiting past end of turn for smine.
authornemo
Sun, 04 Oct 2015 16:30:55 -0400
changeset 11197 8e0e3b79efa3
parent 11196 f4cf2cdea8e5
child 11198 cc308446f90d
child 11332 560d6a4f4ca7
Avoid waiting past end of turn for smine.
hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Sat Oct 03 17:02:57 2015 -0400
+++ b/hedgewars/uGearsHedgehog.pas	Sun Oct 04 16:30:55 2015 -0400
@@ -451,7 +451,7 @@
             if CurAmmoType = amAirMine then newGear^.Hedgehog:= nil;
 
             if ((CurAmmoType = amMine) or (CurAmmoType = amSMine) or (CurAmmoType = amAirMine)) and (GameFlags and gfInfAttack <> 0) then
-                newGear^.FlightTime:= GameTicks + 1000
+                newGear^.FlightTime:= GameTicks + min(TurnTimeLeft,1000)
             else if CurAmmoType = amDrill then
                 newGear^.FlightTime:= GameTicks + 250;
             if Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then