From 9b2190cd4af88901fef0c0e7343935a7f6fa8739 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Tue, 29 Mar 2022 23:59:07 +0200 Subject: [PATCH] Small fix --- src/client/component/notifies.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/client/component/notifies.cpp b/src/client/component/notifies.cpp index 4d8b6fa9..d2ecb7f3 100644 --- a/src/client/component/notifies.cpp +++ b/src/client/component/notifies.cpp @@ -32,20 +32,20 @@ namespace notifies { if (vm_execute_hooks.find(pos) == vm_execute_hooks.end()) { + hook_enabled = true; return false; } - if (!hook_enabled && pos > (char*)vm_execute_hooks.size()) + if (!hook_enabled && pos > reinterpret_cast(vm_execute_hooks.size())) { hook_enabled = true; return false; } - const auto hook = vm_execute_hooks[pos]; + const auto& hook = vm_execute_hooks[pos]; const auto state = hook.lua_state(); - const auto self_id = local_id_to_entity(game::scr_VmPub->function_frame->fs.localId); - const auto self = scripting::entity(self_id); + const scripting::entity self = local_id_to_entity(game::scr_VmPub->function_frame->fs.localId); std::vector args; @@ -59,16 +59,6 @@ namespace notifies const auto result = hook(self, sol::as_args(args)); scripting::lua::handle_error(result); - const auto value = scripting::lua::convert({state, result}); - const auto type = value.get_raw().type; - - game::Scr_ClearOutParams(); - - if (result.valid() && type && type < game::SCRIPT_END) - { - scripting::push_value(value); - } - return true; } @@ -99,7 +89,7 @@ namespace notifies a.bind(replace); a.popad64(); - a.mov(r14, (char*)empty_function); + a.mov(r14, reinterpret_cast(empty_function)); a.jmp(end); }