Fix hog can drop more than 2 s. mines if first one was dropped from utility, then stop using that utility
authorWuzzy <Wuzzy2@mail.ru>
Wed, 24 Oct 2018 21:07:26 +0200
changeset 13956 2568fa516733
parent 13955 a857cd1cc3f0
child 13957 a4877a16564d
Fix hog can drop more than 2 s. mines if first one was dropped from utility, then stop using that utility Fixes bug #701.
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsHandlersRope.pas
--- a/ChangeLog.txt	Wed Oct 24 21:04:09 2018 +0200
+++ b/ChangeLog.txt	Wed Oct 24 21:07:26 2018 +0200
@@ -19,6 +19,7 @@
  + Remove rubber duck
  * Fix hog being unable to walk after using sniper rifle without firing both shots
  * Fix sine gun dealing damage to attacker if shooting up
+ * Hedgehog was able to drop more than 2 sticky mines if dropping first one from utility, then stop using utility
  * Fix Sudden Death starting in the second turn of a round rather than the first
  * Fix hammer and pickhammer not digging correctly at wrap world edge
  * Fix drill rocket exploding when digging at bounce/wrap world edge
--- a/hedgewars/uGearsHandlersMess.pas	Wed Oct 24 21:04:09 2018 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Wed Oct 24 21:07:26 2018 +0200
@@ -2877,7 +2877,7 @@
             State := State or gstMoving;
             end;
         DeleteGear(Gear);
-        if (GetAmmoEntry(HHGear^.Hedgehog^, amParachute)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
+        if (GetAmmoEntry(HHGear^.Hedgehog^, amParachute)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) and (HHGear^.Hedgehog^.MultiShootAttacks = 0) then
             HHGear^.Hedgehog^.CurAmmoType:= amParachute;
         isCursorVisible := false;
         ApplyAmmoChanges(HHGear^.Hedgehog^);
@@ -4376,7 +4376,7 @@
                 State := State or gstMoving
                 end;
             DeleteGear(Gear);
-            if (GetAmmoEntry(HHGear^.Hedgehog^, amJetpack)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
+            if (GetAmmoEntry(HHGear^.Hedgehog^, amJetpack)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) and (HHGear^.Hedgehog^.MultiShootAttacks = 0) then
                 HHGear^.Hedgehog^.CurAmmoType:= amJetpack;
             isCursorVisible := false;
             ApplyAmmoChanges(HHGear^.Hedgehog^);
--- a/hedgewars/uGearsHandlersRope.pas	Wed Oct 24 21:04:09 2018 +0200
+++ b/hedgewars/uGearsHandlersRope.pas	Wed Oct 24 21:07:26 2018 +0200
@@ -66,7 +66,7 @@
     or (TestCollisionYwithGear(HHGear, 1) <> 0) then
         begin
         DeleteGear(Gear);
-        if (TestCollisionYwithGear(HHGear, 1) <> 0) and (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
+        if (TestCollisionYwithGear(HHGear, 1) <> 0) and (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) and (HHGear^.Hedgehog^.MultiShootAttacks = 0) then
             HHGear^.Hedgehog^.CurAmmoType:= amRope;
         isCursorVisible := false;
         ApplyAmmoChanges(HHGear^.Hedgehog^);
@@ -451,7 +451,7 @@
         HHGear^.State := HHGear^.State and (not (gstAttacking or gstHHJumping or gstHHHJump));
         HHGear^.Message := HHGear^.Message and (not gmAttack);
         DeleteGear(Gear);
-        if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
+        if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) and (HHGear^.Hedgehog^.MultiShootAttacks = 0) then
             HHGear^.Hedgehog^.CurAmmoType:= amRope;
         isCursorVisible := false;
         ApplyAmmoChanges(HHGear^.Hedgehog^);
@@ -529,7 +529,7 @@
                 Message := Message and (not gmAttack)
                 end;
         DeleteGear(Gear);
-        if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
+        if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) and (HHGear^.Hedgehog^.MultiShootAttacks = 0) then
             HHGear^.Hedgehog^.CurAmmoType:= amRope;
         isCursorVisible := false;
         ApplyAmmoChanges(HHGear^.Hedgehog^);