# HG changeset patch # User sheepluva # Date 1296319245 -3600 # Node ID 07e9849c6a70b12f18b30015d4ad852c9bbe1e95 # Parent 55f939e2c19cfb8772d932aa8fdec50853b5a9aa bugfix: fixing sticky mines calling AddGearCI when they shouldn't (allows jumping on them in midair) thanks to CheezeMonkey for discovering this bug also: fix confusing indentation notice: this does NOT fix the hovering-mine-cluster-bug diff -r 55f939e2c19c -r 07e9849c6a70 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat Jan 29 17:40:49 2011 +0300 +++ b/hedgewars/GSHandlers.inc Sat Jan 29 17:40:45 2011 +0100 @@ -1731,41 +1731,45 @@ //////////////////////////////////////////////////////////////////////////////// procedure doStepSMine(Gear: PGear); begin - DeleteCI(Gear); // TODO: do real calculation? if TestCollisionXwithGear(Gear, 2) or TestCollisionYwithGear(Gear, -2) or TestCollisionXwithGear(Gear, -2) or TestCollisionYwithGear(Gear, 2) then begin if (hwAbs(Gear^.dX) > _0) or (hwAbs(Gear^.dY) > _0) then + begin PlaySound(sndRopeAttach); - Gear^.dX:= _0; - Gear^.dY:= _0; + Gear^.dX:= _0; + Gear^.dY:= _0; + AddGearCI(Gear); + end; end else begin + DeleteCI(Gear); doStepFallingGear(Gear); AllInactive := false; CalcRotationDirAngle(Gear); end; - AddGearCI(Gear); if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then + begin if ((Gear^.State and gstAttacking) = 0) then begin if ((GameTicks and $1F) = 0) then if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State := Gear^.State or gstAttacking end - else // gstAttacking <> 0 - begin - AllInactive := false; - if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick); - if Gear^.Timer = 0 then + else // gstAttacking <> 0 begin - doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); - DeleteGear(Gear); - exit - end; - dec(Gear^.Timer); + AllInactive := false; + if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick); + if Gear^.Timer = 0 then + begin + doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); + DeleteGear(Gear); + exit + end; + dec(Gear^.Timer); + end end else // gsttmpFlag = 0 if TurnTimeLeft = 0 then Gear^.State := Gear^.State or gsttmpFlag;