prevent an old abuse of parachute to land safely
authornemo
Wed, 06 Mar 2013 17:06:35 -0500
changeset 8680 5fe344cc8610
parent 8679 a8bdcf7bec20
child 8681 d0fc1dca739c
prevent an old abuse of parachute to land safely
hedgewars/uGearsHandlersRope.pas
--- a/hedgewars/uGearsHandlersRope.pas	Wed Mar 06 16:00:48 2013 -0500
+++ b/hedgewars/uGearsHandlersRope.pas	Wed Mar 06 17:06:35 2013 -0500
@@ -33,6 +33,14 @@
     HHGear: PGear;
 begin
     HHGear := Gear^.Hedgehog^.Gear;
+    if (HHGear^.Hedgehog^.CurAmmoType = amParachute) and (HHGear^.dY > _0_39) then
+        begin
+        DeleteGear(Gear);
+        ApplyAmmoChanges(HHGear^.Hedgehog^);
+        HHGear^.Message:= HHGear^.Message or gmLJump;
+        exit
+        end;
+
     if ((HHGear^.State and gstHHDriven) = 0)
     or (CheckGearDrowning(HHGear))
     or (TestCollisionYwithGear(HHGear, 1) <> 0) then