Allow harvester definitions to exist on non-mobile actors

This commit is contained in:
Gustas
2023-10-21 22:51:43 +03:00
committed by Matthias Mailänder
parent 8e7fa26709
commit d67e0a4eef
2 changed files with 11 additions and 8 deletions

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits
Actor = actor;
Harvester = actor.Trait<Harvester>();
Parachutable = actor.TraitOrDefault<Parachutable>();
Mobile = actor.Trait<Mobile>();
Mobile = actor.TraitOrDefault<Mobile>();
}
}
@@ -110,6 +110,9 @@ namespace OpenRA.Mods.Common.Traits
// Find idle harvesters and give them orders:
foreach (var h in harvesters)
{
if (h.Value.Mobile == null)
continue;
if (!h.Key.IsIdle)
{
// Ignore this actor if FindAndDeliverResources is working fine or it is performing a different activity