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

@@ -72,18 +72,9 @@ namespace OpenRA.Mods.Cnc.Activities
public override Activity Tick(Actor self)
{
if (canceled)
return NextActivity;
// Correct the visual position after we jumped
if (jumpComplete)
{
if (ChildActivity == null)
return NextActivity;
ChildActivity = ActivityUtils.RunActivity(self, ChildActivity);
return this;
}
if (canceled || jumpComplete)
return NextActivity;
if (target.Type != TargetType.Invalid)
targetPosition = target.CenterPosition;
@@ -106,9 +97,7 @@ namespace OpenRA.Mods.Cnc.Activities
attack.DoAttack(self, target);
jumpComplete = true;
QueueChild(self, mobile.VisualMove(self, position, self.World.Map.CenterOfSubCell(destinationCell, destinationSubCell)), true);
return this;
QueueChild(mobile.VisualMove(self, position, self.World.Map.CenterOfSubCell(destinationCell, destinationSubCell)));
}
return this;