From 94a773a1d5ffd9c46e406a6779aa2b4cec864ff8 Mon Sep 17 00:00:00 2001 From: ErLullo Date: Thu, 19 Feb 2026 12:09:33 +0100 Subject: [PATCH] Refactor fog settings handling in MapUtil --- src/GameLib/MapUtil.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/GameLib/MapUtil.cpp b/src/GameLib/MapUtil.cpp index 8b735a8..f64bdce 100644 --- a/src/GameLib/MapUtil.cpp +++ b/src/GameLib/MapUtil.cpp @@ -117,17 +117,23 @@ bool Environment_Load(SEnvironmentData& envData, const char* envFileName) if (textLoader.SetChildNode("fog")) { - // MR-14: Fog update by Alaric - // textLoader.GetTokenBoolean("enable", &envData.bFogEnable); - // textLoader.GetTokenBoolean("isdensity", &envData.bDensityFog); - // textLoader.GetTokenFloat("neardistance", &envData.m_fFogNearDistance); - // textLoader.GetTokenFloat("fardistance", &envData.m_fFogFarDistance); - textLoader.GetTokenByte("foglevel", &envData.bFogLevel); - // MR-14: -- END OF -- Fog update by Alaric + if (textLoader.GetTokenByte("foglevel", &envData.bFogLevel)) + { + envData.bDensityFog = true; + } + else + { + envData.bDensityFog = false; + textLoader.GetTokenBoolean("enable", &envData.bFogEnable); + textLoader.GetTokenFloat("neardistance", &envData.m_fFogNearDistance); + textLoader.GetTokenFloat("fardistance", &envData.m_fFogFarDistance); + } + textLoader.GetTokenColor("color", &envData.FogColor); + textLoader.SetParentNode(); } - + if (textLoader.SetChildNode("filter")) { textLoader.GetTokenBoolean("enable", (BOOL *) &envData.bFilteringEnable);