diff --git a/OpenRA.Mods.Common/ShroudExts.cs b/OpenRA.Mods.Common/ShroudExts.cs index dd7d31bfce..be2298cb53 100644 --- a/OpenRA.Mods.Common/ShroudExts.cs +++ b/OpenRA.Mods.Common/ShroudExts.cs @@ -26,6 +26,16 @@ namespace OpenRA.Mods.Common return false; } + public static bool AnyExplored(this Shroud shroud, PPos[] puvs) + { + // PERF: Avoid LINQ. + foreach (var puv in puvs) + if (shroud.IsExplored(puv)) + return true; + + return false; + } + public static bool AnyVisible(this Shroud shroud, Pair[] cells) { // PERF: Avoid LINQ. diff --git a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs index 4375b3e463..b2dc307a82 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs @@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits { // If fog is disabled visibility is determined by shroud if (!byPlayer.Shroud.FogEnabled) - return byPlayer.Shroud.AnyExplored(self.OccupiesSpace.OccupiedCells()); + return byPlayer.Shroud.AnyExplored(footprint); return frozenStates[byPlayer].IsVisible; }