Fix AI idle harvester management

This was broken because our default mods now list `harv` under `ExcludeFromSquads`, which prevents them from being added to `activeUnits`.
This commit is contained in:
reaperrr
2018-07-31 23:20:18 +02:00
committed by reaperrr
parent 35600d9291
commit 6c401f0f9a
2 changed files with 13 additions and 8 deletions

View File

@@ -61,18 +61,15 @@ namespace OpenRA.Mods.Common.AI
return path[0];
}
public void Tick(List<Actor> activeUnits)
public void Tick(List<Actor> harvesters)
{
if (resLayer == null || resLayer.IsResourceLayerEmpty)
return;
// Find idle harvesters and give them orders:
foreach (var harvester in activeUnits)
foreach (var harvester in harvesters)
{
var harv = harvester.TraitOrDefault<Harvester>();
if (harv == null)
continue;
var harv = harvester.Trait<Harvester>();
if (!harv.IsEmpty)
continue;