From f31e0e823dd3dff1f99883ae42b524e4064c954c Mon Sep 17 00:00:00 2001 From: NSGolova Date: Thu, 25 Apr 2024 00:27:42 +0100 Subject: [PATCH] Fixed crash on soft restart --- include/UI/CaptorClanUI.hpp | 1 + src/UI/CaptorClanUI.cpp | 4 ++++ src/UI/LeaderboardUI.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/include/UI/CaptorClanUI.hpp b/include/UI/CaptorClanUI.hpp index 361d23f..ab1962f 100644 --- a/include/UI/CaptorClanUI.hpp +++ b/include/UI/CaptorClanUI.hpp @@ -14,4 +14,5 @@ namespace CaptorClanUI { void initCaptorClan(UnityEngine::GameObject* header, TMPro::TextMeshProUGUI* headerPanelText); void setClan(ClanRankingStatus clanStatus); void setActive(bool active); + void Reset(); } \ No newline at end of file diff --git a/src/UI/CaptorClanUI.cpp b/src/UI/CaptorClanUI.cpp index e94cea3..b87d662 100644 --- a/src/UI/CaptorClanUI.cpp +++ b/src/UI/CaptorClanUI.cpp @@ -223,4 +223,8 @@ namespace CaptorClanUI { setClan(lastStatus); } } + + void Reset() { + mainPanel = NULL; + } } \ No newline at end of file diff --git a/src/UI/LeaderboardUI.cpp b/src/UI/LeaderboardUI.cpp index 70d01a6..2d62bc5 100644 --- a/src/UI/LeaderboardUI.cpp +++ b/src/UI/LeaderboardUI.cpp @@ -1348,6 +1348,7 @@ namespace LeaderboardUI { linkContainer = NULL; settingsContainer = NULL; contextsContainer = NULL; + loginPrompt = NULL; preferencesButton = NULL; parentScreen = NULL; sspageUpButton = NULL; @@ -1357,6 +1358,7 @@ namespace LeaderboardUI { cellBackgrounds = {}; showBeatLeaderButton = NULL; upPageButton = NULL; + CaptorClanUI::Reset(); ssWasOpened = false; if (ssInstalled) { showBeatLeader = getModConfig().ShowBeatleader.GetValue();