Fix rope angle possible to go below 0° if having secondary weapon selected
authorWuzzy <almikes@aol.com>
Wed, 11 Oct 2017 20:16:00 +0200
changeset 12696 286afe079117
parent 12695 260f907dd99c
child 12697 cb6b70392459
Fix rope angle possible to go below 0° if having secondary weapon selected
ChangeLog.txt
hedgewars/uAmmos.pas
--- a/ChangeLog.txt	Wed Oct 11 18:52:50 2017 +0200
+++ b/ChangeLog.txt	Wed Oct 11 20:16:00 2017 +0200
@@ -57,6 +57,7 @@
  * Fixed sticky mine sound sometimes playing when shooting portable portal device when a sticky mine is placed on terrain
  * Fixed player being able to switch to dying hog
  * Fixed hedgehog holding nothing in hand when napalm or piano strike got selected
+ * Fixed possible to move rope angle below 0° while having secondary weapon selected
  * Remove buggy /finish chat command
  * Various other fixes
 
--- a/hedgewars/uAmmos.pas	Wed Oct 11 18:52:50 2017 +0200
+++ b/hedgewars/uAmmos.pas	Wed Oct 11 20:16:00 2017 +0200
@@ -331,11 +331,19 @@
         begin
         if (AmmoType <> amNothing) then
             begin
-            CurMinAngle:= Ammoz[AmmoType].minAngle;
-            if Ammoz[AmmoType].maxAngle <> 0 then
-                CurMaxAngle:= Ammoz[AmmoType].maxAngle
+            if ((CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amRope)) then
+                begin
+                CurMaxAngle:= Ammoz[amRope].maxAngle;
+                CurMinAngle:= Ammoz[amRope].minAngle;
+                end
             else
-                CurMaxAngle:= cMaxAngle;
+                begin
+                CurMinAngle:= Ammoz[AmmoType].minAngle;
+                if Ammoz[AmmoType].maxAngle <> 0 then
+                    CurMaxAngle:= Ammoz[AmmoType].maxAngle
+                else
+                    CurMaxAngle:= cMaxAngle;
+                end;
 
             with Hedgehog.Gear^ do
                 begin