Increase IMove.MoveTo call flexibility.

This commit is contained in:
tovl
2019-09-06 21:48:15 +02:00
committed by abcdefg30
parent 28dbda29e3
commit 3236499fb7
7 changed files with 14 additions and 22 deletions

View File

@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Cnc.Activities
// Add a CloseEnough range of 512 to the Rearm/Repair activities in order to ensure that we're at the host actor
QueueChild(new MoveAdjacentTo(self, Target.FromActor(rearmTarget)));
QueueChild(movement.MoveTo(self.World.Map.CellContaining(rearmTarget.CenterPosition), rearmTarget));
QueueChild(movement.MoveTo(self.World.Map.CellContaining(rearmTarget.CenterPosition), ignoreActor: rearmTarget));
QueueChild(new Resupply(self, rearmTarget, new WDist(512)));
returnToBase = true;
return false;

View File

@@ -118,7 +118,7 @@ namespace OpenRA.Mods.Cnc.Traits
self.QueueActivity(move.MoveWithinRange(order.Target, WDist.FromCells(maxDistance.Value), targetLineColor: Color.LawnGreen));
self.QueueActivity(new Teleport(self, cell, maxDistance, Info.KillCargo, Info.FlashScreen, Info.ChronoshiftSound));
self.QueueActivity(move.MoveTo(cell, 5, Color.LawnGreen));
self.QueueActivity(move.MoveTo(cell, 5, targetLineColor: Color.LawnGreen));
self.ShowTargetLines();
}
}

View File

@@ -180,8 +180,8 @@ namespace OpenRA.Mods.Cnc.Traits
self.World.UpdateMaps(self, this);
}
public Activity MoveTo(CPos cell, int nearEnough, Color? targetLineColor = null) { return null; }
public Activity MoveTo(CPos cell, Actor ignoreActor, Color? targetLineColor = null) { return null; }
public Activity MoveTo(CPos cell, int nearEnough = 0, Actor ignoreActor = null,
bool evaluateNearestMovableCell = false, Color? targetLineColor = null) { return null; }
public Activity MoveWithinRange(Target target, WDist range,
WPos? initialTargetPosition = null, Color? targetLineColor = null) { return null; }
public Activity MoveWithinRange(Target target, WDist minRange, WDist maxRange,