more refs to Game.world (PathSearch)
This commit is contained in:
@@ -45,10 +45,10 @@ namespace OpenRa.Traits.Activities
|
||||
var refineries = self.World.Actors.Where( x => x.traits.Contains<AcceptsOre>()
|
||||
&& x.Owner == self.Owner ).ToList();
|
||||
if( refinery != null )
|
||||
search.AddInitialCell( refinery.Location + refineryDeliverOffset );
|
||||
search.AddInitialCell( self.World, refinery.Location + refineryDeliverOffset );
|
||||
else
|
||||
foreach( var r in refineries )
|
||||
search.AddInitialCell( r.Location + refineryDeliverOffset );
|
||||
search.AddInitialCell( self.World, r.Location + refineryDeliverOffset );
|
||||
|
||||
var path = self.World.PathFinder.FindPath( search );
|
||||
path.Reverse();
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRa.Traits.Activities
|
||||
umt = UnitMovementType.Wheel,
|
||||
checkForBlocked = true
|
||||
};
|
||||
search.AddInitialCell(self.Location);
|
||||
search.AddInitialCell(self.World, self.Location);
|
||||
return self.World.PathFinder.FindPath(search);
|
||||
}));
|
||||
self.QueueActivity(new Harvest());
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRa.Traits.Activities
|
||||
{
|
||||
this.getPath = (self, mobile) =>
|
||||
self.World.PathFinder.FindPath(
|
||||
PathSearch.FromPoint( self.Location, destination, mobile.GetMovementType(), false )
|
||||
PathSearch.FromPoint( self.World, self.Location, destination, mobile.GetMovementType(), false )
|
||||
.WithCustomBlocker( self.World.PathFinder.AvoidUnitsNear( self.Location, 4 )).WithIgnoredBuilding( ignoreBuilding ));
|
||||
|
||||
this.destination = destination;
|
||||
|
||||
Reference in New Issue
Block a user