# HG changeset patch
# User sheepluva
# Date 1385370738 -3600
# Node ID b8b7ef99a084543c46f6b08f6690861d0b70b6bb
# Parent  f1698baccaefb4a27eef0c97ad1bfd50396ec2cc
don't let (am)Nothing change allowed aiming angles. e.g. fixes aiming problems when on last rope. please test for possible side effects (flying saucer and whatnot)

diff -r f1698baccaef -r b8b7ef99a084 hedgewars/uAmmos.pas
--- 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:= '';