Pathfinder uses a MobileInfo instead of a specific actor

This commit is contained in:
Paul Chote
2010-09-09 23:25:58 +12:00
parent 706adb6d0b
commit f9445cb282
7 changed files with 50 additions and 38 deletions

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Traits.Activities
{
this.getPath = (self,mobile) =>
self.World.PathFinder.FindPath(
PathSearch.FromPoint( self, mobile.toCell, destination, false )
PathSearch.FromPoint( self.World, mobile.Info, mobile.toCell, destination, false )
.WithoutLaneBias());
this.destination = destination;
this.nearEnough = 0;
@@ -55,8 +55,7 @@ namespace OpenRA.Traits.Activities
public Move( int2 destination, int nearEnough )
: this()
{
this.getPath = (self,mobile) => self.World.PathFinder.FindUnitPath(
mobile.toCell, destination, self );
this.getPath = (self,mobile) => self.World.PathFinder.FindUnitPath( mobile.toCell, destination, self );
this.destination = destination;
this.nearEnough = nearEnough;
}
@@ -66,7 +65,7 @@ namespace OpenRA.Traits.Activities
{
this.getPath = (self,mobile) =>
self.World.PathFinder.FindPath(
PathSearch.FromPoint( self, mobile.toCell, destination, false )
PathSearch.FromPoint( self.World, mobile.Info, mobile.toCell, destination, false )
.WithCustomBlocker( self.World.PathFinder.AvoidUnitsNear( mobile.toCell, 4, self ))
.WithIgnoredBuilding( ignoreBuilding ));