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

@@ -54,8 +54,8 @@ namespace OpenRA.Mods.RA.Move
var mi = self.Info.Traits.Get<MobileInfo>();
var pb = FindBidiPath(
PathSearch.FromPoint(world, mi, target, from, true),
PathSearch.FromPoint(world, mi, from, target, true)
PathSearch.FromPoint(world, mi, self.Owner, target, from, true),
PathSearch.FromPoint(world, mi, self.Owner, from, target, true)
.InReverse());
CheckSanePath2(pb, from, target);
@@ -72,11 +72,11 @@ namespace OpenRA.Mods.RA.Move
{
var mi = self.Info.Traits.Get<MobileInfo>();
var tilesInRange = world.FindTilesInCircle(target, range)
.Where( t => mi.CanEnterCell(self.World, t, null, true));
.Where( t => mi.CanEnterCell(self.World, self.Owner, t, null, true));
var path = FindBidiPath(
PathSearch.FromPoints(world, mi, tilesInRange, src, true),
PathSearch.FromPoint(world, mi, src, target, true)
PathSearch.FromPoints(world, mi, self.Owner, tilesInRange, src, true),
PathSearch.FromPoint(world, mi, self.Owner, src, target, true)
.InReverse());
return path;