diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index cbc3146afd..a6f0774318 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -27,6 +27,7 @@ namespace OpenRA.Mods.Common.AI public class UnitCategories { public readonly HashSet Mcv = new HashSet(); + public readonly HashSet ExcludeFromSquads = new HashSet(); } public class BuildingCategories @@ -150,7 +151,7 @@ namespace OpenRA.Mods.Common.AI [Desc("What buildings to the AI should build.", "What % of the total base must be this type of building.")] public readonly Dictionary BuildingFractions = null; - [Desc("Tells the AI what unit types fall under the same common name. Only supported entry is Mcv.")] + [Desc("Tells the AI what unit types fall under the same common name. Supported entries are Mcv and ExcludeFromSquads.")] [FieldLoader.LoadUsing("LoadUnitCategories", true)] public readonly UnitCategories UnitsCommonNames; @@ -678,7 +679,8 @@ namespace OpenRA.Mods.Common.AI void FindNewUnits(Actor self) { var newUnits = self.World.ActorsHavingTrait() - .Where(a => a.Owner == Player && !Info.UnitsCommonNames.Mcv.Contains(a.Info.Name) && !activeUnits.Contains(a)); + .Where(a => a.Owner == Player && !Info.UnitsCommonNames.Mcv.Contains(a.Info.Name) && + !Info.UnitsCommonNames.ExcludeFromSquads.Contains(a.Info.Name) && !activeUnits.Contains(a)); foreach (var a in newUnits) {