Replace SequenceActivities with ChildActivity in several air activities.

This commit is contained in:
tovl
2019-03-30 16:13:31 +01:00
committed by Paul Chote
parent 7fe2d1223b
commit 8ee11028d7
2 changed files with 20 additions and 4 deletions

View File

@@ -47,6 +47,13 @@ namespace OpenRA.Mods.Common.Activities
public override Activity Tick(Actor self)
{
if (ChildActivity != null)
{
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
if (ChildActivity != null)
return this;
}
// Refuse to take off if it would land immediately again.
if (aircraft.ForceLanding)
Cancel(self);
@@ -89,9 +96,8 @@ namespace OpenRA.Mods.Common.Activities
}
wasMovingWithinRange = true;
return ActivityUtils.SequenceActivities(self,
aircraft.MoveWithinRange(target, minRange, maxRange, checkTarget.CenterPosition, targetLineColor),
this);
QueueChild(self, aircraft.MoveWithinRange(target, minRange, maxRange, checkTarget.CenterPosition, targetLineColor), true);
return this;
}
}
}