hedgewars/uAmmos.pas
branch1.0.0
changeset 15805 23e16f33b528
parent 15466 6031c0cfec89
child 15857 f0f615dcbe7c
--- a/hedgewars/uAmmos.pas	Thu Jun 04 12:33:24 2020 +0200
+++ b/hedgewars/uAmmos.pas	Tue Apr 13 15:40:11 2021 -0400
@@ -406,7 +406,7 @@
     CurWeapon:= GetCurAmmoEntry(Hedgehog);
     OldWeapon:= GetCurAmmoEntry(Hedgehog);
 
-    if (Hedgehog.Gear^.State and gstHHDriven) = 0 then
+    if (Hedgehog.Gear <> nil) and (Hedgehog.Gear^.State and gstHHDriven = 0) then
         Hedgehog.CurAmmoType:= amNothing
     else if (CurWeapon^.Count = 0) then
         SwitchToFirstLegalAmmo(Hedgehog)
@@ -431,7 +431,7 @@
             s:= s + ansistring(' (' + IntToStr(Count) + ')');
         if (Propz and ammoprop_Timerable) <> 0 then
             s:= s + ansistring(', ' + IntToStr(Timer div 1000) + ' ') + trammo[sidSeconds];
-        if (Hedgehog.Gear^.State and gstHHDriven) <> 0 then
+        if (Hedgehog.Gear <> nil) and (Hedgehog.Gear^.State and gstHHDriven <> 0) then
             AddCaption(s, Team^.Clan^.Color, capgrpAmmoinfo);
         if (Propz and ammoprop_NeedTarget) <> 0 then
             begin