Using Locomotor instead of Info for pathfinding
This commit is contained in:
@@ -181,7 +181,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
// Find any harvestable resources:
|
||||
List<CPos> path;
|
||||
using (var search = PathSearch.Search(self.World, locomotorInfo, self, true, loc =>
|
||||
using (var search = PathSearch.Search(self.World, mobile.Locomotor, self, true, loc =>
|
||||
domainIndex.IsPassable(self.Location, loc, locomotorInfo) && harv.CanHarvestCell(self, loc) && claimLayer.CanClaimCell(self, loc))
|
||||
.WithCustomCost(loc =>
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
List<CPos> path;
|
||||
using (var search =
|
||||
PathSearch.FromPoint(self.World, mobile.Info.LocomotorInfo, self, mobile.ToCell, destination, false)
|
||||
PathSearch.FromPoint(self.World, mobile.Locomotor, self, mobile.ToCell, destination, false)
|
||||
.WithoutLaneBias())
|
||||
path = self.World.WorldActor.Trait<IPathFinder>().FindPath(search);
|
||||
return path;
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (!searchCells.Any())
|
||||
return NoPath;
|
||||
|
||||
using (var fromSrc = PathSearch.FromPoints(self.World, Mobile.Info.LocomotorInfo, self, searchCells, loc, true))
|
||||
using (var fromDest = PathSearch.FromPoint(self.World, Mobile.Info.LocomotorInfo, self, loc, lastVisibleTargetLocation, true).Reverse())
|
||||
using (var fromSrc = PathSearch.FromPoints(self.World, Mobile.Locomotor, self, searchCells, loc, true))
|
||||
using (var fromDest = PathSearch.FromPoint(self.World, Mobile.Locomotor, self, loc, lastVisibleTargetLocation, true).Reverse())
|
||||
return pathFinder.FindBidiPath(fromSrc, fromDest);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user