hedgewars/uGearsHandlersMess.pas
changeset 15745 4e65fd69f58c
parent 15744 498c1482dec2
child 15746 ff7291bc811f
--- a/hedgewars/uGearsHandlersMess.pas	Sun Jul 12 01:27:27 2020 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Sun Jul 12 03:03:52 2020 +0300
@@ -1237,22 +1237,22 @@
     AllInactive := false;
 
     if ((Gear^.State and gstAnimation) = 0) then
-        begin
+    begin
         dec(Gear^.Timer);
         if Gear^.Timer = 0 then
-            begin
+        begin
             PlaySound(sndShotgunFire);
             CreateShellForGear(Gear, 0);
             Gear^.State := Gear^.State or gstAnimation
-            end;
-            exit
-        end else
-        if(Gear^.Hedgehog^.Gear = nil) or ((Gear^.Hedgehog^.Gear^.State and gstMoving) <> 0) then
-            begin
+        end
+        else if (Gear^.Hedgehog^.Gear = nil)
+            or ((Gear^.Hedgehog^.Gear^.State and (gstMoving or gstHHDriven)) = gstMoving) then
+        begin
             DeleteGear(Gear);
             AfterAttack;
-            exit
-            end
+        end;
+        exit
+    end
     else
         inc(Gear^.Timer);