From 38e4f75411ade2fbd543419ba29ff5239e8db93b Mon Sep 17 00:00:00 2001 From: /dev/urandom Date: Thu, 1 Jun 2017 02:13:53 +0200 Subject: [PATCH] [QuickPatch] Fix crash caused by drawing mini console when no graphics initialized. --- src/Components/Modules/QuickPatch.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index 050dbe57..27b66b8d 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -655,13 +655,16 @@ namespace Components // Constantly draw the mini console Utils::Hook::Set(0x412A45, 0xEB); - Scheduler::OnFrame([] () - { - if (*reinterpret_cast(0x62E4BAC)) + + if (!Dedicated::IsEnabled() && !ZoneBuilder::IsEnabled()) { + Scheduler::OnFrame([]() { - Game::Con_DrawMiniConsole(0, 2, 4, (Game::CL_IsCgameInitialized() ? 1.0f : 0.4f)); - } - }); + if (*reinterpret_cast(0x62E4BAC)) + { + Game::Con_DrawMiniConsole(0, 2, 4, (Game::CL_IsCgameInitialized() ? 1.0f : 0.4f)); + } + }); + } #else // Remove missing tag message Utils::Hook::Nop(0x4EBF1A, 5);