Use Mobile.Pathfinder to reduce trait look-ups
This commit is contained in:
@@ -803,12 +803,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (CanEnterCell(above))
|
||||
return above;
|
||||
|
||||
var pathFinder = self.World.WorldActor.Trait<IPathFinder>();
|
||||
List<CPos> path;
|
||||
using (var search = PathSearch.Search(self.World, Locomotor, self, BlockedByActor.All,
|
||||
loc => loc.Layer == 0 && CanEnterCell(loc))
|
||||
.FromPoint(self.Location))
|
||||
path = pathFinder.FindPath(search);
|
||||
path = Pathfinder.FindPath(search);
|
||||
|
||||
if (path.Count > 0)
|
||||
return path[0];
|
||||
|
||||
Reference in New Issue
Block a user