moved Game.PathFinder into World
This commit is contained in:
@@ -50,7 +50,7 @@ namespace OpenRa.Traits.Activities
|
||||
foreach( var r in refineries )
|
||||
search.AddInitialCell( r.Location + refineryDeliverOffset );
|
||||
|
||||
var path = Game.PathFinder.FindPath( search );
|
||||
var path = Game.world.PathFinder.FindPath( search );
|
||||
path.Reverse();
|
||||
if( path.Count != 0 )
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenRa.Traits.Activities
|
||||
checkForBlocked = true
|
||||
};
|
||||
search.AddInitialCell(self.Location);
|
||||
return Game.PathFinder.FindPath(search);
|
||||
return Game.world.PathFinder.FindPath(search);
|
||||
}));
|
||||
self.QueueActivity(new Harvest());
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRa.Traits.Activities
|
||||
|
||||
public Move( int2 destination, int nearEnough )
|
||||
{
|
||||
this.getPath = ( self, mobile ) => Game.PathFinder.FindUnitPath(
|
||||
this.getPath = ( self, mobile ) => Game.world.PathFinder.FindUnitPath(
|
||||
self.Location, destination,
|
||||
mobile.GetMovementType() );
|
||||
this.destination = destination;
|
||||
@@ -30,9 +30,9 @@ namespace OpenRa.Traits.Activities
|
||||
public Move(int2 destination, Actor ignoreBuilding)
|
||||
{
|
||||
this.getPath = (self, mobile) =>
|
||||
Game.PathFinder.FindPath(
|
||||
Game.world.PathFinder.FindPath(
|
||||
PathSearch.FromPoint( self.Location, destination, mobile.GetMovementType(), false )
|
||||
.WithCustomBlocker( Game.PathFinder.AvoidUnitsNear( self.Location, 4 )).WithIgnoredBuilding( ignoreBuilding ));
|
||||
.WithCustomBlocker( Game.world.PathFinder.AvoidUnitsNear( self.Location, 4 )).WithIgnoredBuilding( ignoreBuilding ));
|
||||
|
||||
this.destination = destination;
|
||||
this.nearEnough = 0;
|
||||
@@ -41,7 +41,7 @@ namespace OpenRa.Traits.Activities
|
||||
|
||||
public Move( Actor target, int range )
|
||||
{
|
||||
this.getPath = ( self, mobile ) => Game.PathFinder.FindUnitPathToRange(
|
||||
this.getPath = ( self, mobile ) => Game.world.PathFinder.FindUnitPathToRange(
|
||||
self.Location, target.Location,
|
||||
mobile.GetMovementType(), range );
|
||||
this.destination = null;
|
||||
|
||||
Reference in New Issue
Block a user