From 1853ddde944210ca59e0efb45e74a97997c3f115 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Mon, 23 Mar 2015 23:23:01 +0000 Subject: [PATCH] Use MPos indexer for CellLayer in Shroud. This reduces us to one conversion per cell rather than two or three. --- OpenRA.Game/Traits/World/Shroud.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index efc1bd498b..67fd8f42a6 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -128,8 +128,9 @@ namespace OpenRA.Traits foreach (var c in visible) { - visibleCount[c]++; - explored[c] = true; + var uv = c.ToMPos(map); + visibleCount[uv]++; + explored[uv] = true; } if (visibility.ContainsKey(a)) @@ -146,7 +147,7 @@ namespace OpenRA.Traits return; foreach (var c in visible) - visibleCount[c]--; + visibleCount[c.ToMPos(map)]--; visibility.Remove(a); Invalidate(visible);