Fix FrozenUnderFog visibility calculation when fog is disabled.
This commit is contained in:
@@ -26,6 +26,16 @@ namespace OpenRA.Mods.Common
|
|||||||
return false;
|
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)
|
public static bool AnyVisible(this Shroud shroud, Pair<CPos, SubCell>[] cells)
|
||||||
{
|
{
|
||||||
// PERF: Avoid LINQ.
|
// PERF: Avoid LINQ.
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
// If fog is disabled visibility is determined by shroud
|
// If fog is disabled visibility is determined by shroud
|
||||||
if (!byPlayer.Shroud.FogEnabled)
|
if (!byPlayer.Shroud.FogEnabled)
|
||||||
return byPlayer.Shroud.AnyExplored(self.OccupiesSpace.OccupiedCells());
|
return byPlayer.Shroud.AnyExplored(footprint);
|
||||||
|
|
||||||
return frozenStates[byPlayer].IsVisible;
|
return frozenStates[byPlayer].IsVisible;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user