From 1e27c6cbc3d176a3e9bed1ff11897c5f6dfac4e8 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Thu, 23 Dec 2021 02:15:49 +0100 Subject: [PATCH] Revert "Fix loading last checkpoint not running scripts" This reverts commit dc3af7412cf234298b05fe65e67707fb514710c1. --- src/client/component/scripting.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/client/component/scripting.cpp b/src/client/component/scripting.cpp index 7a997136..c6ad6c0e 100644 --- a/src/client/component/scripting.cpp +++ b/src/client/component/scripting.cpp @@ -97,31 +97,6 @@ namespace scripting script_function_table[current_file][function_name] = codePos; scr_set_thread_position_hook.invoke(threadName, codePos); } - - void sv_initgame_stub(utils::hook::assembler& a) - { - const auto loc_6B3170 = a.newLabel(); - const auto loc_6B3151 = a.newLabel(); - - a.test(ebp, ebp); - a.jz(loc_6B3151); - a.cmp(qword_ptr(rsi), 0); - a.jnz(loc_6B3170); - - a.bind(loc_6B3151); - a.call(0x76D750_b); - a.call(0x6B4A00_b); - a.call(0x4C8F00_b); - a.jmp(0x6B3160_b); - - a.bind(loc_6B3170); - - a.pushad64(); - a.call_aligned(lua::engine::start); - a.popad64(); - - a.jmp(0x6B3170_b); - } } class component final : public component_interface @@ -138,9 +113,6 @@ namespace scripting scr_set_thread_position_hook.create(0x5BC7E0_b, scr_set_thread_position_stub); process_script_hook.create(0x5C6160_b, process_script_stub); - // Loading last checkpoint doesn't call spawn player again - utils::hook::jump(0x6B3147_b, utils::hook::assemble(sv_initgame_stub), true); - scheduler::loop([]() { lua::engine::run_frame();