diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 1c76073b..e4e6c2c0 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -322,6 +322,12 @@ namespace Components { if (Game::Sys_IsMainThread()) { + if (*Game::g_quitRequested) + { + // No need to refresh if we're exiting the game + return; + } + Game::sharedUiInfo_t* uiInfo = reinterpret_cast(0x62E4B78); uiInfo->updateArenas = 1; Game::UI_UpdateArenas(); diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index e2d26a17..0b90782c 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -17,6 +17,7 @@ namespace Game G_DebugLineWithDuration_t G_DebugLineWithDuration = G_DebugLineWithDuration_t(0x4C3280); gentity_s* g_entities = reinterpret_cast(0x18835D8); + bool* g_quitRequested = reinterpret_cast(0x649FB61); NetField* clientStateFields = reinterpret_cast(0x741E40); size_t clientStateFieldsCount = Utils::Hook::Get(0x7433C8); diff --git a/src/Game/Game.hpp b/src/Game/Game.hpp index 12d81a94..12b3fe9c 100644 --- a/src/Game/Game.hpp +++ b/src/Game/Game.hpp @@ -52,6 +52,7 @@ namespace Game constexpr std::size_t MAX_GENTITIES = 2048; constexpr std::size_t ENTITYNUM_NONE = MAX_GENTITIES - 1; extern gentity_s* g_entities; + extern bool* g_quitRequested; // This does not belong anywhere else extern NetField* clientStateFields;