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

@@ -44,20 +44,14 @@ namespace OpenRA.Mods.Common.Activities
if (assignTargetOnFirstRun)
destination = Target.FromCell(self.World, self.Location);
QueueChild(self, new Land(self, destination, deliverRange), true);
QueueChild(self, new Wait(carryall.Info.BeforeUnloadDelay, false), true);
QueueChild(self, new ReleaseUnit(self));
QueueChild(self, new TakeOff(self));
QueueChild(new Land(self, destination, deliverRange));
QueueChild(new Wait(carryall.Info.BeforeUnloadDelay, false));
QueueChild(new ReleaseUnit(self));
QueueChild(new TakeOff(self));
}
public override Activity Tick(Actor self)
{
if (ChildActivity != null)
{
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
if (ChildActivity != null)
return this;
}
return NextActivity;
}