Add missing nil check in AfterAttack (oops!)
authorWuzzy <Wuzzy2@mail.ru>
Mon, 03 Sep 2018 20:16:54 +0200
changeset 13753 885404cdf07a
parent 13752 f1c66a34f2fe
child 13754 5525f69bf76b
Add missing nil check in AfterAttack (oops!)
hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Mon Sep 03 20:01:50 2018 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Mon Sep 03 20:16:54 2018 +0200
@@ -638,7 +638,7 @@
                 begin
                 if TagTurnTimeLeft = 0 then
                     TagTurnTimeLeft:= TurnTimeLeft;
-                if (HHGear^.State and gstHHDriven) <> 0 then
+                if (HHGear <> nil) and ((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