Rewrite Mobile.MoveIntoTarget to support moving targets.

This commit is contained in:
Paul Chote
2019-01-31 20:30:34 +00:00
committed by Oliver Brakmann
parent 1f7b558b29
commit d2274f4285
4 changed files with 103 additions and 3 deletions

View File

@@ -517,7 +517,9 @@ namespace OpenRA.Mods.Common.Traits
if (target.Type == TargetType.Invalid)
return null;
return VisualMove(self, self.CenterPosition, target.Positions.PositionClosestTo(self.CenterPosition));
// Activity cancels if the target moves by more than half a cell
// to avoid problems with the cell grid
return new VisualMoveIntoTarget(self, target, new WDist(512));
}
public Activity VisualMove(Actor self, WPos fromPos, WPos toPos)