Move ChildActivity handling into base Activity class.

This commit is contained in:
tovl
2019-04-30 22:45:02 +02:00
committed by teinarss
parent 37379daf3c
commit b9c302a73a
43 changed files with 139 additions and 342 deletions

View File

@@ -39,13 +39,6 @@ namespace OpenRA.Mods.Common.Activities
public override Activity Tick(Actor self)
{
if (ChildActivity != null)
{
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
if (ChildActivity != null)
return this;
}
if (IsCanceling || isDocking)
return NextActivity;
@@ -56,7 +49,7 @@ namespace OpenRA.Mods.Common.Activities
// No refineries exist; check again after delay defined in Harvester.
if (harv.LinkedProc == null)
{
QueueChild(self, new Wait(harv.Info.SearchForDeliveryBuildingDelay), true);
QueueChild(new Wait(harv.Info.SearchForDeliveryBuildingDelay));
return this;
}
@@ -69,13 +62,13 @@ namespace OpenRA.Mods.Common.Activities
foreach (var n in self.TraitsImplementing<INotifyHarvesterAction>())
n.MovingToRefinery(self, proc, new FindAndDeliverResources(self));
QueueChild(self, movement.MoveTo(proc.Location + iao.DeliveryOffset, 0), true);
QueueChild(movement.MoveTo(proc.Location + iao.DeliveryOffset, 0));
return this;
}
if (!isDocking)
{
QueueChild(self, new Wait(10), true);
QueueChild(new Wait(10));
isDocking = true;
iao.OnDock(self, this);
return this;