Fix Service Depot Rally point path finding (+rename ignoredActor)

This commit is contained in:
rob-v
2017-04-09 19:14:25 +02:00
parent 669cf01d80
commit fb1d8d780f
8 changed files with 19 additions and 37 deletions

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
/// Calculates a path for the actor from source to destination
/// </summary>
/// <returns>A path from start to target</returns>
List<CPos> FindUnitPath(CPos source, CPos target, Actor self);
List<CPos> FindUnitPath(CPos source, CPos target, Actor self, Actor ignoreActor);
List<CPos> FindUnitPathToRange(CPos source, SubCell srcSub, WPos target, WDist range, Actor self);
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits
this.world = world;
}
public List<CPos> FindUnitPath(CPos source, CPos target, Actor self)
public List<CPos> FindUnitPath(CPos source, CPos target, Actor self, Actor ignoreActor)
{
var mi = self.Info.TraitInfo<MobileInfo>();
@@ -74,8 +74,8 @@ namespace OpenRA.Mods.Common.Traits
}
List<CPos> pb;
using (var fromSrc = PathSearch.FromPoint(world, mi, self, target, source, true))
using (var fromDest = PathSearch.FromPoint(world, mi, self, source, target, true).Reverse())
using (var fromSrc = PathSearch.FromPoint(world, mi, self, target, source, true).WithIgnoredActor(ignoreActor))
using (var fromDest = PathSearch.FromPoint(world, mi, self, source, target, true).WithIgnoredActor(ignoreActor).Reverse())
pb = FindBidiPath(fromSrc, fromDest);
CheckSanePath2(pb, source, target);