# HG changeset patch # User alfadur # Date 1594506447 -10800 # Node ID 498c1482dec261a15a7c73b20d92abde42344a59 # Parent 1244c64b8e2848610bd2ce449833e50fb7dac24b add collision to land sentries diff -r 1244c64b8e28 -r 498c1482dec2 hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Sun Jul 12 01:08:42 2020 +0300 +++ b/hedgewars/uCollisions.pas Sun Jul 12 01:27:27 2020 +0300 @@ -671,7 +671,7 @@ if (Gear <> info.cGear) and ((centerX > info.X) xor (Dir > 0)) and ((info.cGear^.State and gstNotKickable) = 0) - and ((info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife]) + and ((info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtSentry]) or (info.cGear^.Kind = gtExplosives) and ((info.cGear^.State and gsttmpflag) <> 0)) // only apply X kick if the barrel is knocked over and (sqr(centerX - info.X) + sqr(centerY - info.Y) <= sqr(info.Radius + Gear^.Radius + 2)) then begin @@ -718,7 +718,7 @@ if (Gear <> info.cGear) and ((centerY + Gear^.Radius > info.Y) xor (Dir > 0)) and (info.cGear^.State and gstNotKickable = 0) - and (info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtExplosives]) + and (info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtExplosives, gtSentry]) and (sqr(centerX - info.X) + sqr(centerY - info.Y) <= sqr(info.Radius + Gear^.Radius + 2)) then begin with info.cGear^ do diff -r 1244c64b8e28 -r 498c1482dec2 hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Sun Jul 12 01:08:42 2020 +0300 +++ b/hedgewars/uGearsHandlersMess.pas Sun Jul 12 01:27:27 2020 +0300 @@ -7388,16 +7388,20 @@ if Gear^.dY.isNegative or (TestCollisionYwithGear(Gear, 1) = 0) then begin + DeleteCI(Gear); doStepFallingGear(Gear); if not (Gear^.Tag in [sentry_Idle, sentry_Reloading]) then ResetSentryState(Gear, sentry_Idle, 1000); exit; - end; + end + else + AddCI(Gear); if Gear^.Timer > 0 then dec(Gear^.Timer); if Gear^.Timer = 0 then begin + DeleteCI(Gear); if Gear^.Tag = sentry_Idle then begin Gear^.Tag := sentry_Walking; @@ -7474,12 +7478,15 @@ Gear^.Timer := 100; end end; + AddCI(Gear); end; if (Gear^.Tag = sentry_Walking) and ((GameTicks and $1F) = 0) then begin + DeleteCI(Gear); if not MakeSentryStep(Gear, 6, false) then - Gear^.Timer := 0 + Gear^.Timer := 0; + AddCI(Gear); end; if ((GameTicks and $1F) = 0) and (Gear^.Tag = sentry_Aiming) then