added local unit avoidance for path-to-range

This commit is contained in:
Chris Forbes
2009-11-09 17:47:32 +13:00
parent e8ee03bcc6
commit 0a6580b9bf

View File

@@ -61,7 +61,7 @@ namespace OpenRa.Game
var tilesInRange = Game.FindTilesInCircle(target, range)
.Where( t => Game.IsCellBuildable( t, umt ) );
var path = FindPath( PathSearch.FromPoints( tilesInRange, src, umt, false ));
var path = FindPath( PathSearch.FromPoints( tilesInRange, src, umt, false ).WithCustomBlocker(AvoidUnitsNear(src, 4)));
path.Reverse();
return path;
}