Skip to content

Commit

Permalink
ShroudRenderer, fix, render Shroud if fog disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
anvilvapre authored and Smittytron committed Sep 3, 2022
1 parent e2284f6 commit 57ce88c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions OpenRA.Game/Traits/Player/Shroud.cs
Expand Up @@ -441,7 +441,7 @@ public CellVisibility GetVisibility(PPos puv)

if (Disabled)
{
if (FogEnabled)
if (fogEnabled)
{
// Shroud disabled, Fog enabled
if (resolvedType.Contains(puv))
Expand All @@ -457,7 +457,7 @@ public CellVisibility GetVisibility(PPos puv)
}
else
{
if (FogEnabled)
if (fogEnabled)
{
// Shroud and Fog enabled
if (resolvedType.Contains(puv))
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs
Expand Up @@ -280,15 +280,15 @@ Edges GetEdges(Shroud.CellVisibility[] neighbors, Shroud.CellVisibility visibleM
var cv = cellVisibility(puv);

// If a cell is covered by shroud, then all neigbhors are covered by shroud and fog.
if (cv == Shroud.CellVisibility.Hidden)
if (!cv.HasFlag(Shroud.CellVisibility.Explored))
return notVisibleEdgesPair;

var ncv = GetNeighborsVisbility(puv);

// If a cell is covered by fog, then all neigbhors are as well.
var edgesFog = cv.HasFlag(Shroud.CellVisibility.Visible) ? GetEdges(ncv, Shroud.CellVisibility.Visible) : notVisibleEdgesPair.Item2;

var edgesShroud = GetEdges(ncv, Shroud.CellVisibility.Explored | Shroud.CellVisibility.Visible);
var edgesShroud = GetEdges(ncv, Shroud.CellVisibility.Explored);
return (edgesShroud, edgesFog);
}

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Widgets/RadarWidget.cs
Expand Up @@ -255,7 +255,7 @@ void UpdateShroudCell(PPos puv)
{
var color = 0;
var cv = currentPlayer.Shroud.GetVisibility(puv);
if (cv == Shroud.CellVisibility.Hidden)
if (!cv.HasFlag(Shroud.CellVisibility.Explored))
color = ColorShroud;
else if (!cv.HasFlag(Shroud.CellVisibility.Visible))
color = ColorFog;
Expand Down

0 comments on commit 57ce88c

Please sign in to comment.