Pathfinder uses a MobileInfo instead of a specific actor
This commit is contained in:
@@ -62,11 +62,11 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
var res = self.World.WorldActor.Trait<ResourceLayer>();
|
||||
var harv = self.Info.Traits.Get<HarvesterInfo>();
|
||||
|
||||
var mobileInfo = self.Info.Traits.Get<MobileInfo>();
|
||||
self.QueueActivity(new Move(
|
||||
() =>
|
||||
{
|
||||
return self.World.PathFinder.FindPath(PathSearch.Search(self, true)
|
||||
return self.World.PathFinder.FindPath(PathSearch.Search(self.World, mobileInfo, true)
|
||||
.WithHeuristic(loc => (res.GetResource(loc) != null && harv.Resources.Contains( res.GetResource(loc).info.Name )) ? 0 : 1)
|
||||
.FromPoint(self.Location));
|
||||
}));
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace OpenRA.Mods.RA
|
||||
var refs = self.World.Queries.OwnedBy[self.Owner]
|
||||
.Where(x => x != ignore && x.HasTrait<IAcceptOre>())
|
||||
.ToList();
|
||||
|
||||
var path = self.World.PathFinder.FindPath(PathSearch.FromPoints(self,
|
||||
var mi = self.Info.Traits.Get<MobileInfo>();
|
||||
var path = self.World.PathFinder.FindPath(PathSearch.FromPoints(self.World, mi,
|
||||
refs.Select(r => r.Location + r.Trait<IAcceptOre>().DeliverOffset),
|
||||
self.Location,
|
||||
false));
|
||||
|
||||
Reference in New Issue
Block a user