more refs to Game.world (PathSearch)

This commit is contained in:
Bob
2010-01-21 13:51:09 +13:00
parent 232ed72bbf
commit 02ce7990c0
5 changed files with 24 additions and 24 deletions

View File

@@ -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();

View File

@@ -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());

View File

@@ -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;