Add an extra sanity check.

This commit is contained in:
Paul Chote
2013-06-22 12:43:32 +12:00
parent 7bce2017c3
commit b95cd0c91f

View File

@@ -113,6 +113,9 @@ namespace OpenRA.Traits
explored[c.X, c.Y] = true;
}
if (visibility.ContainsKey(a))
throw new InvalidOperationException("Attempting to add duplicate actor visibility");
visibility[a] = visible;
Invalidate();
}
@@ -147,6 +150,9 @@ namespace OpenRA.Traits
foreach (var c in shrouded)
generatedShroudCount[c.X, c.Y]++;
if (generation.ContainsKey(a))
throw new InvalidOperationException("Attempting to add duplicate shroud generation");
generation[a] = shrouded;
Invalidate();
}