From 41f28f2519c62818ffe1030248e27e35419fec58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 30 Aug 2024 19:19:39 +0200 Subject: [PATCH] Guard the trait lookup. --- OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs index 2196545422..56679bb1f7 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs @@ -183,7 +183,7 @@ namespace OpenRA.Mods.Common.Traits if (modifiers.HasModifier(TargetModifiers.ForceAttack) && !string.IsNullOrEmpty(info.ForceSetType)) { var closest = self.World.Selection.Actors - .Where(a => a.TraitOrDefault()?.Info.ForceSetType == info.ForceSetType) + .Where(a => !a.IsDead && a.IsInWorld && a.TraitOrDefault()?.Info.ForceSetType == info.ForceSetType) .ClosestToIgnoringPath(target.CenterPosition); ForceSet = closest == self;