Fix using parachute while staying on the ground
authorunc0rr
Mon, 21 May 2007 15:42:21 +0000
changeset 516 f682e134ac2e
parent 515 270f10276d2e
child 517 ba560c17c24c
Fix using parachute while staying on the ground
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Fri May 18 17:35:12 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Mon May 21 15:42:21 2007 +0000
@@ -988,6 +988,8 @@
 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
 HHGear^.State:= HHGear^.State and not gstAttacking;
 
+inc(Gear^.Timer);
+
 if TestCollisionYwithGear(HHGear, 1)
    or ((HHGear^.State and gstHHDriven) = 0)
    or CheckGearDrowning(HHGear) then
@@ -1001,8 +1003,11 @@
         State:= State or gstFalling;
         end;
    DeleteGear(Gear);
-   OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^.Ammo);
-   ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^);
+   if Gear^.Timer > 10 then
+      begin
+      OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^.Ammo);
+      ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^)
+      end;
    exit
    end;