FIX works

This commit is contained in:
Chris Forbes
2010-01-02 09:05:41 +13:00
parent 5487edf369
commit 37bc4f2279
9 changed files with 103 additions and 28 deletions

View File

@@ -15,6 +15,7 @@ namespace OpenRa.Game
Func<int2, bool> customBlock;
public bool checkForBlocked;
public bool ignoreTerrain;
public Actor ignoreBuilding;
public PathSearch()
{
@@ -28,6 +29,12 @@ namespace OpenRa.Game
return this;
}
public PathSearch WithIgnoredBuilding(Actor b)
{
ignoreBuilding = b;
return this;
}
public int2 Expand( float[][ , ] passableCost )
{
var p = queue.Pop();
@@ -49,7 +56,8 @@ namespace OpenRa.Game
{
if (passableCost[(int)umt][newHere.X, newHere.Y] == float.PositiveInfinity)
continue;
if (!Game.BuildingInfluence.CanMoveHere(newHere))
if (!Game.BuildingInfluence.CanMoveHere(newHere) &&
Game.BuildingInfluence.GetBuildingAt(newHere) != ignoreBuilding)
continue;
if (Rules.Map.IsOverlaySolid(newHere))
continue;