Use MPos indexer for CellLayer in Shroud.
This reduces us to one conversion per cell rather than two or three.
This commit is contained in:
@@ -128,8 +128,9 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
foreach (var c in visible)
|
foreach (var c in visible)
|
||||||
{
|
{
|
||||||
visibleCount[c]++;
|
var uv = c.ToMPos(map);
|
||||||
explored[c] = true;
|
visibleCount[uv]++;
|
||||||
|
explored[uv] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visibility.ContainsKey(a))
|
if (visibility.ContainsKey(a))
|
||||||
@@ -146,7 +147,7 @@ namespace OpenRA.Traits
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var c in visible)
|
foreach (var c in visible)
|
||||||
visibleCount[c]--;
|
visibleCount[c.ToMPos(map)]--;
|
||||||
|
|
||||||
visibility.Remove(a);
|
visibility.Remove(a);
|
||||||
Invalidate(visible);
|
Invalidate(visible);
|
||||||
|
|||||||
Reference in New Issue
Block a user