Rope: Keep rope selected if sliding on ground and secondary weapon selected
authorWuzzy <almikes@aol.com>
Wed, 11 Oct 2017 23:41:25 +0200
changeset 12695 28210d2a9a36
parent 12694 e96f0f89ba0c
child 12696 975639969f83
Rope: Keep rope selected if sliding on ground and secondary weapon selected For consistency w/ previous rope commit
hedgewars/uGearsHandlersRope.pas
--- a/hedgewars/uGearsHandlersRope.pas	Wed Oct 11 23:14:29 2017 +0200
+++ b/hedgewars/uGearsHandlersRope.pas	Wed Oct 11 23:41:25 2017 +0200
@@ -66,6 +66,8 @@
     or (TestCollisionYwithGear(HHGear, 1) <> 0) then
         begin
         DeleteGear(Gear);
+        if (TestCollisionYwithGear(HHGear, 1) <> 0) and (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and (HHGear^.Hedgehog^.CurAmmoType <> amRope) then
+            SetWeapon(amRope);
         isCursorVisible := false;
         ApplyAmmoChanges(HHGear^.Hedgehog^);
         exit