# HG changeset patch # User Wuzzy # Date 1507907385 -7200 # Node ID 16fcd59295e347140a076e1ff89e577e3ea1d7ca # Parent 608db0fb90f0bf41d62ea785e72f06c31ace8f07 Don't switch back to rope/chute/jetpack if selected ammo is not ammoprop_AltUse This fixes a regression like that you can't shoryuken after rope. diff -r 608db0fb90f0 -r 16fcd59295e3 hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Thu Oct 12 20:30:39 2017 +0200 +++ b/hedgewars/uGearsHandlersMess.pas Fri Oct 13 17:09:45 2017 +0200 @@ -2616,7 +2616,7 @@ State := State or gstMoving; end; DeleteGear(Gear); - if (GetAmmoEntry(HHGear^.Hedgehog^, TAmmoType(amParachute))^.Count >= 1) and (HHGear^.Hedgehog^.CurAmmoType <> amParachute) then + if (GetAmmoEntry(HHGear^.Hedgehog^, amParachute)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then SetWeapon(amParachute); isCursorVisible := false; ApplyAmmoChanges(HHGear^.Hedgehog^); @@ -4019,7 +4019,7 @@ State := State or gstMoving end; DeleteGear(Gear); - if (GetAmmoEntry(HHGear^.Hedgehog^, TAmmoType(amJetpack))^.Count >= 1) and (HHGear^.Hedgehog^.CurAmmoType <> amJetpack) then + if (GetAmmoEntry(HHGear^.Hedgehog^, amJetpack)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then SetWeapon(amJetpack); isCursorVisible := false; ApplyAmmoChanges(HHGear^.Hedgehog^); diff -r 608db0fb90f0 -r 16fcd59295e3 hedgewars/uGearsHandlersRope.pas --- a/hedgewars/uGearsHandlersRope.pas Thu Oct 12 20:30:39 2017 +0200 +++ b/hedgewars/uGearsHandlersRope.pas Fri Oct 13 17:09:45 2017 +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 (HHGear^.Hedgehog^.CurAmmoType <> amRope) then + if (TestCollisionYwithGear(HHGear, 1) <> 0) and (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then SetWeapon(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 (HHGear^.Hedgehog^.CurAmmoType <> amRope) then + if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then SetWeapon(amRope); exit() end; @@ -545,7 +545,7 @@ Message := Message and (not gmAttack) end; DeleteGear(Gear); - if GetAmmoEntry(HHGear^.Hedgehog^, TAmmoType(amRope))^.Count >= 1 then + if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then SetWeapon(amRope); exit; end;