From a939a536f37c595bb13c11ffeff7d1519239e037 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Thu, 6 Apr 2023 23:55:10 +0200 Subject: [PATCH] Workaround out-of-gobblegums --- src/client/component/script.cpp | 8 ++++++++ src/client/game/symbols.hpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/component/script.cpp b/src/client/component/script.cpp index f840f406..4a9e3eb6 100644 --- a/src/client/component/script.cpp +++ b/src/client/component/script.cpp @@ -13,6 +13,8 @@ namespace script namespace { utils::hook::detour db_findxassetheader_hook; + utils::hook::detour gscr_get_bgb_remaining_hook; + std::unordered_map loaded_scripts; game::RawFile* get_loaded_script(const std::string& name) @@ -110,6 +112,11 @@ namespace script return asset_header; } + + void gscr_get_bgb_remaining_stub(game::scriptInstance_t inst, void* entref) + { + game::Scr_AddInt(game::SCRIPTINSTANCE_SERVER, 255); + } } struct component final : generic_component @@ -126,6 +133,7 @@ namespace script } db_findxassetheader_hook.create(game::select(0x141420ED0, 0x1401D5FB0), db_findxassetheader_stub); + gscr_get_bgb_remaining_hook.create(game::select(0x141A8CAB0, 0x1402D2310), gscr_get_bgb_remaining_stub); } }; }; diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index c2fd5aec..7d41fc0e 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -139,7 +139,7 @@ namespace game WEAK symbol CL_CheckKeepDrawingConnectScreen{0x1413CCAE0}; // Scr - WEAK symbol Scr_AddInt{0x0, 0x14016F160}; + WEAK symbol Scr_AddInt{0x1412E9870, 0x14016F160}; WEAK symbol Scr_AddString{0x0, 0x14016F320}; WEAK symbol Scr_GetString{0x0, 0x140171490}; WEAK symbol Scr_Notify_Canon{