use bidi pathing for moving into range (MoveToAdjacent-style hack)
This commit is contained in:
@@ -72,15 +72,18 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
{
|
{
|
||||||
using( new PerfSample( "Pathfinder" ) )
|
using( new PerfSample( "Pathfinder" ) )
|
||||||
{
|
{
|
||||||
var mobileInfo = self.Info.Traits.Get<MobileInfo>();
|
var mi = self.Info.Traits.Get<MobileInfo>();
|
||||||
var tilesInRange = world.FindTilesInCircle(target, range)
|
var tilesInRange = world.FindTilesInCircle(target, range)
|
||||||
.Where( t => Mobile.CanEnterCell(self.World, mobileInfo, t, null, true));
|
.Where( t => Mobile.CanEnterCell(self.World, mi, t, null, true));
|
||||||
|
|
||||||
var path = FindPath( PathSearch.FromPoints( world, mobileInfo, tilesInRange, src, false )
|
var path = FindBidiPath(
|
||||||
.WithCustomBlocker(AvoidUnitsNear(src, 4, self))
|
PathSearch.FromPoints(world, mi, tilesInRange, src, true)
|
||||||
.InReverse());
|
.WithCustomBlocker(AvoidUnitsNear(src, 4, self)),
|
||||||
path.Reverse();
|
PathSearch.FromPoint(world, mi, src, target, true)
|
||||||
return path;
|
.WithCustomBlocker(AvoidUnitsNear(src, 4, self))
|
||||||
|
.InReverse());
|
||||||
|
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user