harvester Harvest order works with queues

fix for autocarryable harvesters

Make use of QueueActivity's own handling of order.Queued
This commit is contained in:
tovl
2019-02-09 23:30:23 +01:00
committed by reaperrr
parent 307a87cd9e
commit 3bfa32ca33
3 changed files with 45 additions and 39 deletions

View File

@@ -36,6 +36,12 @@ namespace OpenRA.Mods.Common.Activities
public override Activity Tick(Actor self)
{
if (ChildActivity != null)
{
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
return this;
}
if (IsCanceling)
{
claimLayer.RemoveClaim(self);
@@ -56,7 +62,10 @@ namespace OpenRA.Mods.Common.Activities
var current = facing.Facing;
var desired = body.QuantizeFacing(current, harvInfo.HarvestFacings);
if (desired != current)
return ActivityUtils.SequenceActivities(self, new Turn(self, desired), this);
{
QueueChild(self, new Turn(self, desired), true);
return this;
}
}
var resource = resLayer.Harvest(self.Location);
@@ -71,7 +80,8 @@ namespace OpenRA.Mods.Common.Activities
foreach (var t in self.TraitsImplementing<INotifyHarvesterAction>())
t.Harvested(self, resource);
return ActivityUtils.SequenceActivities(self, new Wait(harvInfo.BaleLoadDelay), this);
QueueChild(self, new Wait(harvInfo.BaleLoadDelay), true);
return this;
}
}
}