From 40bad1b813133faee3baea6a50d785d3eae49837 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 9 Nov 2009 18:20:14 +1300 Subject: [PATCH] #47 fixed --- OpenRa.Game/Ore.cs | 6 ++++++ OpenRa.Game/PathSearch.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/OpenRa.Game/Ore.cs b/OpenRa.Game/Ore.cs index 90005f01e9..69e58b5feb 100644 --- a/OpenRa.Game/Ore.cs +++ b/OpenRa.Game/Ore.cs @@ -137,6 +137,12 @@ namespace OpenRa.Game return ore; } + public static bool IsOverlaySolid(this Map map, int2 p) + { + var o = map.MapTiles[p.X, p.Y].overlay; + return o < overlayIsFence.Length && overlayIsFence[o]; + } + public static bool[] overlayIsFence = { true, true, true, true, true, diff --git a/OpenRa.Game/PathSearch.cs b/OpenRa.Game/PathSearch.cs index 9967d2b77c..dcfee5c826 100755 --- a/OpenRa.Game/PathSearch.cs +++ b/OpenRa.Game/PathSearch.cs @@ -47,6 +47,8 @@ namespace OpenRa.Game continue; if (customBlock != null && customBlock(newHere)) continue; + if (Game.map.IsOverlaySolid(newHere)) + continue; var est = heuristic( newHere ); if( est == float.PositiveInfinity )