From 6fbdc2c221ec6cf9aa5f96b7a345352baf65eb32 Mon Sep 17 00:00:00 2001 From: dnqbob Date: Fri, 18 Nov 2022 16:18:24 +0800 Subject: [PATCH] HarvesterBotModule should not command harvesters that cannot be ordered --- OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs index 7907bf7001..cd40925970 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/HarvesterBotModule.cs @@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Traits // Find new harvesters // TODO: Look for a more performance-friendly way to update this list - var newHarvesters = world.ActorsHavingTrait().Where(a => a.Owner == player && !harvesters.ContainsKey(a)); + var newHarvesters = world.ActorsHavingTrait().Where(a => !unitCannotBeOrdered(a) && !harvesters.ContainsKey(a)); foreach (var a in newHarvesters) harvesters[a] = new HarvesterTraitWrapper(a);