Fix broken logic for the new parachute feature
authorunc0rr
Sun, 13 Apr 2008 12:29:26 +0000
changeset 839 1493f697d1bb
parent 838 1faae19f2116
child 840 3c0028245ff3
Fix broken logic for the new parachute feature
hedgewars/HHHandlers.inc
hedgewars/uCollisions.pas
--- a/hedgewars/HHHandlers.inc	Sat Apr 12 18:16:12 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Sun Apr 13 12:29:26 2008 +0000
@@ -415,16 +415,15 @@
     or (StepTicks = cHHStepTicks)
 	or (CurAmmoGear <> nil) then // we're moving
 	begin
+	with PHedgehog(Gear^.Hedgehog)^ do
+		if (CurAmmoGear = nil)
+		and (Gear^.dY > _0_39)
+		and (Ammo^[CurSlot, CurAmmo].AmmoType = amParachute) then Gear^.Message:= Gear^.Message or gm_Attack;
 	// check for case with ammo
 	t:= CheckGearNear(Gear, gtCase, 36, 36);
 	if t <> nil then
 		PickUp(Gear, t)
-	end else
-	if ((Gear^.State and gstMoving) <> 0) then
-		with PHedgehog(Gear^.Hedgehog)^ do
-			if (CurAmmoGear = nil)
-			and (Gear^.dY > _0_39)
-			and (Ammo^[CurSlot, CurAmmo].AmmoType = amParachute) then Gear^.Message:= Gear^.Message or gm_Attack;
+	end; 
 
 if CurAmmoGear <> nil then
    begin
--- a/hedgewars/uCollisions.pas	Sat Apr 12 18:16:12 2008 +0000
+++ b/hedgewars/uCollisions.pas	Sun Apr 13 12:29:26 2008 +0000
@@ -241,7 +241,7 @@
 
 if flag then
    begin
-   if hwAbs(Gear^.dX) < cHHKick then exit(true);
+   if hwAbs(Gear^.dY) < cHHKick then exit(true);
    mx:= hwRound(Gear^.X);
    my:= hwRound(Gear^.Y);