diff -r 97be4f6bf264 -r 9e8e64b2bb9e hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Wed Nov 28 21:35:54 2018 +0300 +++ b/hedgewars/uGearsHandlersMess.pas Thu Nov 29 01:23:14 2018 +0300 @@ -1852,9 +1852,14 @@ prevX: LongInt; begin AllInactive := false; - WorldWrap(Gear); dec(Gear^.Timer); + if WorldWrap(Gear) or (((Gear^.Timer) mod 500) = 0) then + begin + ClearHitOrder(); + RefillProximityCache(Gear, 100); + end; + if Gear^.Hedgehog^.Gear = nil then begin StopSoundChan(Gear^.SoundChannel); @@ -1918,7 +1923,7 @@ Gear^.Y := HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC); end; HHGear^.State := HHGear^.State or gstNoDamage; - AmmoShove(Gear, Gear^.Boom, 15); + AmmoShoveCache(Gear, Gear^.Boom, 15); HHGear^.State := HHGear^.State and (not gstNoDamage) end; end; @@ -1935,6 +1940,8 @@ if (TurnTimeLeft = 0) or (Gear^.Timer = 0) or ((HHGear^.Message and gmAttack) <> 0) then begin + ClearHitOrder(); + ClearProximityCache(); StopSoundChan(Gear^.SoundChannel); HHGear^.Message := 0; HHGear^.State := HHGear^.State and (not gstNotKickable); @@ -1961,7 +1968,10 @@ HHGear^.Message := 0; HHGear^.State := HHGear^.State or gstNotKickable; Gear^.SoundChannel := LoopSound(sndBlowTorch); - Gear^.doStep := @doStepBlowTorchWork + Gear^.doStep := @doStepBlowTorchWork; + + ClearHitOrder(); + RefillProximityCache(Gear, 100); end;