# HG changeset patch # User alfadur # Date 1543443794 -10800 # Node ID 9e8e64b2bb9e129ce1237bfc5e82f33ee574071c # Parent 97be4f6bf264536f984352a7ec8af5def2b9ba94 make blowtorch hit moving gears 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; diff -r 97be4f6bf264 -r 9e8e64b2bb9e hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Wed Nov 28 21:35:54 2018 +0300 +++ b/hedgewars/uGearsUtils.pas Thu Nov 29 01:23:14 2018 +0300 @@ -1336,7 +1336,7 @@ dec(i); Gear:= t^.ar[i]; if (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet, - gtFirePunch, gtKamikaze, gtWhip, gtShover]) + gtFirePunch, gtKamikaze, gtWhip, gtShover, gtBlowtorch]) and (((Ammo^.Data <> nil) and (PGear(Ammo^.Data) = Gear)) or (not UpdateHitOrder(Gear, Ammo^.WDTimer))) then continue;