diff --git a/src/client/component/script.cpp b/src/client/component/script.cpp index 1e3cdb75..aad8d693 100644 --- a/src/client/component/script.cpp +++ b/src/client/component/script.cpp @@ -157,16 +157,14 @@ namespace script allocator.clear(); } - void load_gametype_script_stub() + void begin_load_scripts_stub(game::scriptInstance_t inst, int user) { - if (!game::Com_IsInGame() || game::Com_IsRunningUILevel()) - { - game::GScr_LoadGametypeScript(); - return; - } + game::Scr_BeginLoadScripts(inst, user); - game::GScr_LoadGametypeScript(); - load_scripts(); + if (game::Com_IsInGame() && !game::Com_IsRunningUILevel()) + { + load_scripts(); + } } int server_script_checksum_stub() @@ -191,8 +189,8 @@ namespace script // Free our scripts when the game ends game_event::on_g_shutdown_game(clear_script_memory); - // Load our scripts when the gametype script is loaded - utils::hook::call(game::select(0x141AAF37C, 0x1402D8C7F), load_gametype_script_stub); + // Load our custom/overriding scripts + utils::hook::call(game::select(0x141AAE92F, 0x1402D81FF), begin_load_scripts_stub); // Force GSC checksums to be valid utils::hook::call(game::select(0x1408F2E5D, 0x1400E2D22), server_script_checksum_stub); diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index ee415ce6..be4d20cd 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -195,6 +195,7 @@ namespace game }; WEAK symbol Scr_GetNumParam{0x0, 0x140171320}; WEAK symbol Scr_LoadScript{0x1412C83F0, 0x140156610}; + WEAK symbol Scr_BeginLoadScripts{0x1412C7DF0, 0x140156010}; WEAK symbol Cinematic_StartPlayback{0x1412BE3A0}; @@ -243,8 +244,6 @@ namespace game 0x1422E9410, 0x1405811E0 }; - WEAK symbol GScr_LoadGametypeScript{0x141AAD850, 0x1402D7140}; - // Variables WEAK symbol cmd_functions{0x15689DF58, 0x14946F860}; WEAK symbol sv_cmd_args{0x15689AE30, 0x14944C740};