hedgewars/uGearsHandlersMess.pas
changeset 15531 6ddfde71ba6a
parent 15498 20066da10268
child 15609 61f2ffcd5652
--- a/hedgewars/uGearsHandlersMess.pas	Tue Nov 19 08:35:32 2019 -0500
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Nov 30 02:54:49 2019 +0100
@@ -3091,6 +3091,16 @@
 
     AfterAttack;
 
+    // Delete parachute early if hog already collides
+    if (TestCollisionXwithGear(HHGear, -1) <> 0) and (TestCollisionXwithGear(HHGear, 1) <> 0) then
+        begin
+        HHGear^.dY := cGravity * 100;
+        isCursorVisible:= false;
+        ApplyAmmoChanges(HHGear^.Hedgehog^);
+        DeleteGear(Gear);
+        exit;
+        end;
+
     // make sure hog doesn't end up facing in wrong direction due to high jump
     if (HHGear^.State and gstHHHJump) <> 0 then
         HHGear^.dX.isNegative := (not HHGear^.dX.isNegative);