From 8db1501523fa8123b6297da5d5e52ee07bb848f4 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:51:10 -0600 Subject: [PATCH] fix HideUI exception error and unable to re-enable --- cheat-library/src/user/cheat/visuals/HideUI.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cheat-library/src/user/cheat/visuals/HideUI.cpp b/cheat-library/src/user/cheat/visuals/HideUI.cpp index 4983d3f..b89216c 100644 --- a/cheat-library/src/user/cheat/visuals/HideUI.cpp +++ b/cheat-library/src/user/cheat/visuals/HideUI.cpp @@ -48,16 +48,18 @@ namespace cheat::feature if (ui_camera == nullptr) ui_camera = app::GameObject_Find(string_to_il2cppi("/UICamera"), nullptr); - if (ui_camera) + if (ui_camera->fields._.m_CachedPtr != nullptr) app::GameObject_SetActive(ui_camera, false, nullptr); } else { if (ui_camera) - { - app::GameObject_SetActive(ui_camera, true, nullptr); + { + if (ui_camera->fields._.m_CachedPtr != nullptr) + app::GameObject_SetActive(ui_camera, true, nullptr); + ui_camera = nullptr; - } + } } } } \ No newline at end of file