From 3a5f7bf289fc8f6909b9680cc11b790b34c19fb5 Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:48:02 +0200 Subject: [PATCH] small `patch_and_redirect` improvement --- src/game_api/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game_api/memory.cpp b/src/game_api/memory.cpp index 30c06b2ca..482e6ac80 100644 --- a/src/game_api/memory.cpp +++ b/src/game_api/memory.cpp @@ -182,7 +182,7 @@ size_t patch_and_redirect(size_t addr, size_t replace_size, const std::string_vi std::memcpy(new_code, (void*)addr, data_size_to_move); } - size_t return_addr = addr + jump_size; + size_t return_addr = addr + replace_size; if (return_to_addr != 0) { return_addr = return_to_addr;