hedgewars/GSHandlers.inc
changeset 516 f682e134ac2e
parent 514 fb8ba88a83c3
child 517 ba560c17c24c
--- 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;