From ab5b730e51a1448ab60b81016e39e8978220a65e 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; + } } }