Remove SequenceActivities.

This commit is contained in:
tovl
2019-07-20 01:10:21 +02:00
committed by reaperrr
parent 86c8dfe96e
commit c5558e2145
4 changed files with 12 additions and 20 deletions

View File

@@ -319,10 +319,9 @@ namespace OpenRA.Mods.Common.Traits
if (cellInfo != null)
{
self.CancelActivity();
var notifyBlocking = new CallFunc(() => self.NotifyBlocker(cellInfo.Cell));
var waitFor = new WaitFor(() => CanEnterCell(cellInfo.Cell));
var move = new Move(self, cellInfo.Cell);
self.QueueActivity(ActivityUtils.SequenceActivities(notifyBlocking, waitFor, move));
self.QueueActivity(new CallFunc(() => self.NotifyBlocker(cellInfo.Cell)));
self.QueueActivity(new WaitFor(() => CanEnterCell(cellInfo.Cell)));
self.QueueActivity(new Move(self, cellInfo.Cell));
Log.Write("debug", "OnNudge (notify next blocking actor, wait and move) #{0} from {1} to {2}",
self.ActorID, self.Location, cellInfo.Cell);
@@ -691,7 +690,10 @@ namespace OpenRA.Mods.Common.Traits
var delta = toPos - fromPos;
var facing = delta.HorizontalLengthSquared != 0 ? delta.Yaw.Facing : Facing;
return ActivityUtils.SequenceActivities(new Turn(self, facing), new Drag(self, fromPos, toPos, length));
var activities = new Turn(self, facing);
activities.Queue(new Drag(self, fromPos, toPos, length));
return activities;
}
CPos? ClosestGroundCell()