From 822a29aa76ace08a7919143e4dbb51d9d041b8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 27 Jul 2024 11:38:10 +0200 Subject: [PATCH] Remove invalid squad members before responding to attack. --- OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs index 939288eb9a..755a6f1b06 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs @@ -476,6 +476,7 @@ namespace OpenRA.Mods.Common.Traits { var protectSq = GetSquadOfType(SquadType.Protection); protectSq ??= RegisterNewSquad(bot, SquadType.Protection, (attacker, WVec.Zero)); + protectSq.Units.RemoveWhere(unitCannotBeOrdered); if (protectSq.IsValid && !protectSq.IsTargetValid(protectSq.CenterUnit())) protectSq.SetActorToTarget((attacker, WVec.Zero));