don't delete shotgun shot after it has parted
authoralfadur
Sun, 12 Jul 2020 03:03:52 +0300
changeset 15723 4e65fd69f58c
parent 15722 498c1482dec2
child 15724 ff7291bc811f
don't delete shotgun shot after it has parted
hedgewars/uGearsHandlersMess.pas
--- 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);