From ee0eeb4bb731f13d68d49fb9e5e264100c873825 Mon Sep 17 00:00:00 2001 From: quaK Date: Thu, 1 Feb 2024 00:54:22 +0200 Subject: [PATCH] fix quit possibly --- src/client/component/branding.cpp | 4 ---- src/client/component/command.cpp | 6 +++++- src/client/game/symbols.hpp | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index 90de6c85..22542448 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -10,10 +10,6 @@ #include "utils/hook.hpp" #include -// Fonts used in game: -// fonts/blender_pro_bold.ttf, fonts/blender_pro_book.ttf, fonts/blender_pro_heavy.ttf, fonts/blender_pro_medium.ttf -// fonts/changelingneo-regular.ttf, fonts/dev.ttf, fonts/fira_mono_bold.ttf, fonts/fira_mono_regular.ttf, fonts/iw6_digital.ttf - namespace branding { namespace diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index e08d44f1..ba2e2f92 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -446,7 +446,11 @@ namespace command private: static void add_commands() { - add("quit", game::Com_Quit_f); + add("quit", []() + { + *game::g_quitRequested = true; + }); + add("crash", []() { *reinterpret_cast(1) = 0; diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index ea92846a..4b57b985 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -23,6 +23,7 @@ namespace game WEAK symbol Com_Error{ 0xB8D830 }; WEAK symbol Com_Quit_f{ 0xBADC90 }; + WEAK symbol j_Com_Quit_f{ 0xD33D10 }; WEAK symbol Com_FrontEnd_IsInFrontEnd{ 0x5AE6C0 }; WEAK symbol Com_FrontEnd_ExitFrontEnd{ 0x5AE4F0 }; @@ -315,4 +316,6 @@ namespace game WEAK symbol db_zip_memory{ 0x525B500 }; WEAK symbol g_streamPos{ 0x5687E30 }; + + WEAK symbol g_quitRequested{ 0x779CD44 }; }