Fix FrozenUnderFog visibility calculation when fog is disabled.

This commit is contained in:
Paul Chote
2019-04-28 15:21:46 +01:00
committed by reaperrr
parent 215af20e62
commit 242ebc5da9
2 changed files with 11 additions and 1 deletions

View File

@@ -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<CPos, SubCell>[] cells)
{
// PERF: Avoid LINQ.

View File

@@ -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;
}