hedgewars/uAmmos.pas
changeset 9717 b8b7ef99a084
parent 9660 267c0005baaf
child 9950 2759212a27de
child 9998 736015b847e3
--- a/hedgewars/uAmmos.pas	Sun Nov 24 22:12:23 2013 -0500
+++ b/hedgewars/uAmmos.pas	Mon Nov 25 10:12:18 2013 +0100
@@ -322,18 +322,21 @@
 if Hedgehog.Gear <> nil then
     with Hedgehog do
         begin
-        CurMinAngle:= Ammoz[AmmoType].minAngle;
-        if Ammoz[AmmoType].maxAngle <> 0 then
-            CurMaxAngle:= Ammoz[AmmoType].maxAngle
-        else
-            CurMaxAngle:= cMaxAngle;
+        if (AmmoType <> amNothing) then
+            begin
+            CurMinAngle:= Ammoz[AmmoType].minAngle;
+            if Ammoz[AmmoType].maxAngle <> 0 then
+                CurMaxAngle:= Ammoz[AmmoType].maxAngle
+            else
+                CurMaxAngle:= cMaxAngle;
 
-        with Hedgehog.Gear^ do
-            begin
-            if Angle < CurMinAngle then
-                Angle:= CurMinAngle;
-            if Angle > CurMaxAngle then
-                Angle:= CurMaxAngle;
+            with Hedgehog.Gear^ do
+                begin
+                if Angle < CurMinAngle then
+                    Angle:= CurMinAngle;
+                if Angle > CurMaxAngle then
+                    Angle:= CurMaxAngle;
+                end
             end
         end
 end;
@@ -509,6 +512,8 @@
     RegisterVariable('ammreinf', @SetAmmoReinforcement, false);
     RegisterVariable('ammstore', @chAddAmmoStore , false);
 
+    CurMinAngle:= 0;
+    CurMaxAngle:= cMaxAngle;
     StoreCnt:= 0;
     ammoLoadout:= '';
     ammoProbability:= '';