From b95cd0c91f8a1a81f400fbd2231bf256d1aa30af Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 22 Jun 2013 12:43:32 +1200 Subject: [PATCH] Add an extra sanity check. --- OpenRA.Game/Traits/World/Shroud.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index 76c8bb571d..b0bd57e877 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -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(); }