# HG changeset patch # User Henek # Date 1293580911 -3600 # Node ID 73aef6a577babe6adefb606f96382de70a37c291 # Parent 7df529b4335cc803dac21a2e740de9a086557310 drill strike falling instead of exploding when exiting ground diff -r 7df529b4335c -r 73aef6a577ba hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Tue Dec 28 18:47:44 2010 -0500 +++ b/hedgewars/GSHandlers.inc Wed Dec 29 01:01:51 2010 +0100 @@ -2885,6 +2885,9 @@ end; //////////////////////////////////////////////////////////////////////////////// +procedure doStepDrill(Gear: PGear); +forward; + procedure doStepDrillDrilling(Gear: PGear); var t: PGearArray; @@ -2913,10 +2916,11 @@ if (Gear^.Timer = 0) or (t^.Count <> 0) or (not TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) - and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) + and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) + and ((Gear^.State and gsttmpFlag) = 0)) // CheckLandValue returns true if the type isn't matched or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then - begin + begin //out of time or exited ground StopSound(Gear^.SoundChannel); if (Gear^.State and gsttmpFlag) <> 0 then @@ -2925,7 +2929,12 @@ doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); DeleteGear(Gear); exit - end; + end + else if not TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) then + begin + StopSound(Gear^.SoundChannel); + Gear^.doStep := @doStepDrill + end; dec(Gear^.Timer); end;