From 57ce88cc9a5ea1e06915a5fa80e11acaeefe54ff Mon Sep 17 00:00:00 2001 From: Vapre Date: Thu, 1 Sep 2022 23:56:24 +0200 Subject: [PATCH] ShroudRenderer, fix, render Shroud if fog disabled. --- OpenRA.Game/Traits/Player/Shroud.cs | 4 ++-- OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs | 4 ++-- OpenRA.Mods.Common/Widgets/RadarWidget.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/Traits/Player/Shroud.cs b/OpenRA.Game/Traits/Player/Shroud.cs index 7f4e694930..aa16c363d9 100644 --- a/OpenRA.Game/Traits/Player/Shroud.cs +++ b/OpenRA.Game/Traits/Player/Shroud.cs @@ -441,7 +441,7 @@ namespace OpenRA.Traits if (Disabled) { - if (FogEnabled) + if (fogEnabled) { // Shroud disabled, Fog enabled if (resolvedType.Contains(puv)) @@ -457,7 +457,7 @@ namespace OpenRA.Traits } else { - if (FogEnabled) + if (fogEnabled) { // Shroud and Fog enabled if (resolvedType.Contains(puv)) diff --git a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs index c91319cf49..a09f10c843 100644 --- a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs +++ b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs @@ -280,7 +280,7 @@ namespace OpenRA.Mods.Common.Traits 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); @@ -288,7 +288,7 @@ namespace OpenRA.Mods.Common.Traits // 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); } diff --git a/OpenRA.Mods.Common/Widgets/RadarWidget.cs b/OpenRA.Mods.Common/Widgets/RadarWidget.cs index 8c182624ef..0317822cd0 100644 --- a/OpenRA.Mods.Common/Widgets/RadarWidget.cs +++ b/OpenRA.Mods.Common/Widgets/RadarWidget.cs @@ -255,7 +255,7 @@ namespace OpenRA.Mods.Common.Widgets { 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;