From 2a3271b0d0d78932d430fed5503c117e5b38d6a8 Mon Sep 17 00:00:00 2001 From: tjk-ws <67940579+tjk-ws@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:09:54 -0500 Subject: [PATCH] Fix autotarget not checking all attack traits for targets --- OpenRA.Mods.Common/Traits/AutoTarget.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/AutoTarget.cs b/OpenRA.Mods.Common/Traits/AutoTarget.cs index 4194c7751a..38f1123f90 100644 --- a/OpenRA.Mods.Common/Traits/AutoTarget.cs +++ b/OpenRA.Mods.Common/Traits/AutoTarget.cs @@ -303,7 +303,9 @@ namespace OpenRA.Mods.Common.Traits if (attackStances != PlayerRelationship.None) { var range = Info.ScanRadius > 0 ? WDist.FromCells(Info.ScanRadius) : ab.GetMaximumRange(); - return ChooseTarget(self, ab, attackStances, range, allowMove, allowTurn); + var target = ChooseTarget(self, ab, attackStances, range, allowMove, allowTurn); + if (target.Type != TargetType.Invalid) + return target; } } }