ShroudRenderer, fix, render Shroud if fog disabled.

This commit is contained in:
Vapre
2022-09-01 23:56:24 +02:00
committed by Smittytron
parent e2284f660c
commit 57ce88cc9a
3 changed files with 5 additions and 5 deletions

View File

@@ -441,7 +441,7 @@ namespace OpenRA.Traits
if (Disabled) if (Disabled)
{ {
if (FogEnabled) if (fogEnabled)
{ {
// Shroud disabled, Fog enabled // Shroud disabled, Fog enabled
if (resolvedType.Contains(puv)) if (resolvedType.Contains(puv))
@@ -457,7 +457,7 @@ namespace OpenRA.Traits
} }
else else
{ {
if (FogEnabled) if (fogEnabled)
{ {
// Shroud and Fog enabled // Shroud and Fog enabled
if (resolvedType.Contains(puv)) if (resolvedType.Contains(puv))

View File

@@ -280,7 +280,7 @@ namespace OpenRA.Mods.Common.Traits
var cv = cellVisibility(puv); var cv = cellVisibility(puv);
// If a cell is covered by shroud, then all neigbhors are covered by shroud and fog. // 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; return notVisibleEdgesPair;
var ncv = GetNeighborsVisbility(puv); var ncv = GetNeighborsVisbility(puv);
@@ -288,7 +288,7 @@ namespace OpenRA.Mods.Common.Traits
// If a cell is covered by fog, then all neigbhors are as well. // 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 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); return (edgesShroud, edgesFog);
} }

View File

@@ -255,7 +255,7 @@ namespace OpenRA.Mods.Common.Widgets
{ {
var color = 0; var color = 0;
var cv = currentPlayer.Shroud.GetVisibility(puv); var cv = currentPlayer.Shroud.GetVisibility(puv);
if (cv == Shroud.CellVisibility.Hidden) if (!cv.HasFlag(Shroud.CellVisibility.Explored))
color = ColorShroud; color = ColorShroud;
else if (!cv.HasFlag(Shroud.CellVisibility.Visible)) else if (!cv.HasFlag(Shroud.CellVisibility.Visible))
color = ColorFog; color = ColorFog;