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

@@ -37,10 +37,10 @@ namespace OpenRA.Mods.Common.Activities
protected override void OnFirstRun(Actor self)
{
if (self.Info.HasTraitInfo<IFacingInfo>())
QueueChild(self, new Turn(self, Facing));
QueueChild(new Turn(self, Facing));
if (self.Info.HasTraitInfo<AircraftInfo>())
QueueChild(self, new Land(self));
QueueChild(new Land(self));
}
public override Activity Tick(Actor self)
@@ -48,12 +48,6 @@ namespace OpenRA.Mods.Common.Activities
if (IsCanceling)
return NextActivity;
if (ChildActivity != null)
{
ActivityUtils.RunActivity(self, ChildActivity);
return this;
}
// Prevent deployment in bogus locations
var transforms = self.TraitOrDefault<Transforms>();
if (transforms != null && !transforms.CanDeploy())
@@ -72,7 +66,7 @@ namespace OpenRA.Mods.Common.Activities
IsInterruptible = false;
// Wait forever
QueueChild(self, new WaitFor(() => false));
QueueChild(new WaitFor(() => false));
makeAnimation.Reverse(self, () => DoTransform(self));
return this;
}