hedgewars/uGearsHedgehog.pas
changeset 15017 7ff86274114e
parent 14984 2d5f1dc637da
child 15043 9a7a5833fad2
--- a/hedgewars/uGearsHedgehog.pas	Fri May 17 22:57:22 2019 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Sat May 18 00:18:52 2019 +0200
@@ -857,19 +857,20 @@
         with Gear^.Hedgehog^ do
             with CurWeapon^ do
                 begin
-                if (Gear^.Message and gmLeft  ) <> 0 then
+                if Ammoz[AmmoType].PosCount < 2 then
+                    exit
+                else if (Gear^.Message and gmLeft  ) <> 0 then
                     Pos:= (Pos - 1 + Ammoz[AmmoType].PosCount) mod Ammoz[AmmoType].PosCount
+                else if (Gear^.Message and gmRight ) <> 0 then
+                    Pos:= (Pos + 1) mod Ammoz[AmmoType].PosCount
                 else
-                    if (Gear^.Message and gmRight ) <> 0 then
-                        Pos:= (Pos + 1) mod Ammoz[AmmoType].PosCount
-    else
+                    exit;
+                GHStepTicks:= 200;
+                exit
+                end;
+
+    if (Gear^.Hedgehog^.Unplaced) then
         exit;
-    GHStepTicks:= 200;
-    exit
-    end;
-
-if (Gear^.Hedgehog^.Unplaced) then
-    exit;
 
     if ((Gear^.Message and gmAnimate) <> 0) then
         begin