From ab1a333f3afd6dd770a422b7bbe549f996560417 Mon Sep 17 00:00:00 2001 From: CallowBlack Date: Thu, 19 May 2022 00:36:24 +0300 Subject: [PATCH] partially fix bug with line in character window bug can still occur if you change `No fog` checkbox to false while being in character window --- cheat-library/src/user/cheat/visuals/NoFog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cheat-library/src/user/cheat/visuals/NoFog.cpp b/cheat-library/src/user/cheat/visuals/NoFog.cpp index 82ac880..5f7bd4e 100644 --- a/cheat-library/src/user/cheat/visuals/NoFog.cpp +++ b/cheat-library/src/user/cheat/visuals/NoFog.cpp @@ -6,6 +6,7 @@ namespace cheat::feature { + static bool _prevEnabledState = false; NoFog::NoFog() : Feature(), NFEX(f_Enabled, "No Fog", "NoFog", "Visuals", false, false) { @@ -41,7 +42,11 @@ namespace cheat::feature void NoFog::OnGameUpdate() { - app::RenderSettings_set_fog(nullptr, !f_Enabled, nullptr); + if (_prevEnabledState != f_Enabled) + { + app::RenderSettings_set_fog(nullptr, !f_Enabled, nullptr); + _prevEnabledState = f_Enabled; + } } }