From 2acfc23f18d77ab695de1cf515a92abafe1ba42c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 23 Aug 2014 10:52:36 +1200 Subject: [PATCH] Account for map edges in Shroud.IsExploredCore. --- OpenRA.Game/Traits/World/Shroud.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index e579db257f..ed3233f52e 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -41,6 +41,7 @@ namespace OpenRA.Traits public int Hash { get; private set; } static readonly Func TruthPredicate = cell => true; + readonly Func shroudEdgeTest; readonly Func fastExploredTest; readonly Func slowExploredTest; readonly Func fastVisibleTest; @@ -63,6 +64,7 @@ namespace OpenRA.Traits fogVisibilities = Exts.Lazy(() => self.TraitsImplementing().ToArray()); + shroudEdgeTest = cell => map.Contains(cell); fastExploredTest = IsExploredCore; slowExploredTest = IsExplored; fastVisibleTest = IsVisibleCore; @@ -256,9 +258,9 @@ namespace OpenRA.Traits if (!map.Cells.Contains(region)) return slowExploredTest; - // If shroud isn't enabled, then we can see everything. + // If shroud isn't enabled, then we can see everything inside the map. if (!ShroudEnabled) - return TruthPredicate; + return shroudEdgeTest; // If shroud is enabled, we can use the fast test that just does the core check. return fastExploredTest;