Add plumbing to support ownership checks in MobileInfo.CanEnterCell.

This commit is contained in:
Paul Chote
2011-07-10 16:54:56 +12:00
parent 47ba4cb285
commit 64b88819a9
9 changed files with 25 additions and 23 deletions

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Activities
cells = new OpenRA.FileFormats.Pair<int2, SubCell>[] {
Pair.New(target.Location, SubCell.FullCell) };
var ps1 = new PathSearch( self.World, mobile.Info )
var ps1 = new PathSearch( self.World, mobile.Info, self.Owner )
{
checkForBlocked = true,
heuristic = location => 0,
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Activities
}
ps1.heuristic = PathSearch.DefaultEstimator( mobile.toCell );
var ps2 = PathSearch.FromPoint( self.World, mobile.Info, mobile.toCell, target.Location, true );
var ps2 = PathSearch.FromPoint( self.World, mobile.Info, self.Owner, mobile.toCell, target.Location, true );
var ret = self.World.WorldActor.Trait<PathFinder>().FindBidiPath( ps1, ps2 );
if( ret.Count > 0 )
ret.RemoveAt( 0 );