From 8d1f72c104210339265f3b8fec9477a68ec55197 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 3 Oct 2020 15:48:39 +0200 Subject: [PATCH] Fix for SquadManagerBotModule Aircraft and ships are immediately assigned a squad, so adding them to `unitsHangingAroundTheBase` is bogus. --- .../Traits/BotModules/SquadManagerBotModule.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs index 1cad57bd4f..3fa0a72716 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/SquadManagerBotModule.cs @@ -257,8 +257,6 @@ namespace OpenRA.Mods.Common.Traits foreach (var a in newUnits) { - unitsHangingAroundTheBase.Add(a); - if (a.Info.HasTraitInfo() && a.Info.HasTraitInfo()) { var air = GetSquadOfType(SquadType.Air); @@ -275,6 +273,8 @@ namespace OpenRA.Mods.Common.Traits ships.Units.Add(a); } + else + unitsHangingAroundTheBase.Add(a); activeUnits.Add(a); } @@ -295,8 +295,7 @@ namespace OpenRA.Mods.Common.Traits var attackForce = RegisterNewSquad(bot, SquadType.Assault); foreach (var a in unitsHangingAroundTheBase) - if (!a.Info.HasTraitInfo() && !Info.NavalUnitsTypes.Contains(a.Info.Name)) - attackForce.Units.Add(a); + attackForce.Units.Add(a); unitsHangingAroundTheBase.Clear(); foreach (var n in notifyIdleBaseUnits)