HarvesterBotModule should not command harvesters that cannot be ordered

This commit is contained in:
dnqbob
2022-11-18 16:18:24 +08:00
committed by abcdefg30
parent 14b5504ea7
commit 6fbdc2c221

View File

@@ -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<Harvester>().Where(a => a.Owner == player && !harvesters.ContainsKey(a));
var newHarvesters = world.ActorsHavingTrait<Harvester>().Where(a => !unitCannotBeOrdered(a) && !harvesters.ContainsKey(a));
foreach (var a in newHarvesters)
harvesters[a] = new HarvesterTraitWrapper(a);