Use WRange for Mobile.MoveWithinRange.

This commit is contained in:
Paul Chote
2013-07-10 19:59:03 +12:00
parent ae987b3c10
commit 91698678a2
6 changed files with 10 additions and 9 deletions

View File

@@ -59,19 +59,20 @@ namespace OpenRA.Mods.RA.Move
}
static readonly List<CPos> NoPath = new List<CPos>();
public Move(Target target, int range)
public Move(Target target, WRange range)
{
this.getPath = (self, mobile) =>
{
if (!target.IsValid)
return NoPath;
// TODO: Adjust range to account for target center position
return self.World.WorldActor.Trait<PathFinder>().FindUnitPathToRange(
mobile.toCell, target.CenterPosition.ToCPos(), range, self);
mobile.toCell, target.CenterPosition.ToCPos(), range.Range / 1024, self);
};
this.destination = null;
this.nearEnough = range;
this.nearEnough = range.Range / 1024;
}
public Move(Func<List<CPos>> getPath)