# HG changeset patch # User alfadur # Date 1634341162 -10800 # Node ID 4ede5e84278a60bec2a8666ce2648111c979777e # Parent 4a1e3d824c343283c3b2c40907fad7bcafbc4a3d paint sentries in clan colors diff -r 4a1e3d824c34 -r 4ede5e84278a hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Sat Oct 16 02:20:15 2021 +0300 +++ b/hedgewars/uGearsHandlersMess.pas Sat Oct 16 02:39:22 2021 +0300 @@ -7373,7 +7373,7 @@ if ((HHGear^.State and gstHHDriven) <> 0) and (HHGear^.CollisionIndex < 0) then begin if sentry^.Hedgehog <> nil then - friendlyTarget := sentry^.Hedgehog^.Team = CurrentHedgehog^.Team; + friendlyTarget := sentry^.Hedgehog^.Team^.Clan = CurrentHedgehog^.Team^.Clan; if not friendlyTarget then GetSentryTarget := HHGear; end diff -r 4a1e3d824c34 -r 4ede5e84278a hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Sat Oct 16 02:20:15 2021 +0300 +++ b/hedgewars/uGearsRender.pas Sat Oct 16 02:39:22 2021 +0300 @@ -1748,8 +1748,8 @@ else DrawSpriteRotatedF(sprCreeper, x, y, 1, hwRound(SignAs(_1,Gear^.dX)), 0); gtSentry: begin DrawSpriteRotated(sprSentry, x, y, hwSign(Gear^.dX), 0); - if Gear^.Tag >= 0 then - DrawCircle(x, y, Gear^.Radius, 1, 255, 0, 0, 255); + if Gear^.Hedgehog <> nil then + DrawCircle(x, y, Gear^.Radius, 2, Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); end; gtGenericFaller: begin // DEBUG: draw gtGenericFaller diff -r 4a1e3d824c34 -r 4ede5e84278a hedgewars/uRender.pas --- a/hedgewars/uRender.pas Sat Oct 16 02:20:15 2021 +0300 +++ b/hedgewars/uRender.pas Sat Oct 16 02:39:22 2021 +0300 @@ -50,6 +50,7 @@ procedure DrawCircle (X, Y, Radius, Width: LongInt); procedure DrawCircle (X, Y, Radius, Width: LongInt; r, g, b, a: Byte); +procedure DrawCircle (X, Y, Radius, Width: LongInt; color: LongWord); procedure DrawCircleFilled (X, Y, Radius: LongInt; r, g, b, a: Byte); procedure DrawLine (X0, Y0, X1, Y1, Width: Single; color: LongWord); inline; @@ -1566,6 +1567,13 @@ untint; end; +procedure DrawCircle(X, Y, Radius, Width: LongInt; color: LongWord); +begin + Tint(color); + DrawCircle(X, Y, Radius, Width); + untint; +end; + procedure DrawCircle(X, Y, Radius, Width: LongInt); var i: LongInt;