Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alicealys committed Mar 29, 2022
1 parent 2c14dc1 commit 9b2190c
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/client/component/notifies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char*>(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<sol::lua_value> args;

Expand All @@ -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;
}

Expand Down Expand Up @@ -99,7 +89,7 @@ namespace notifies
a.bind(replace);

a.popad64();
a.mov(r14, (char*)empty_function);
a.mov(r14, reinterpret_cast<char*>(empty_function));
a.jmp(end);
}

Expand Down

0 comments on commit 9b2190c

Please sign in to comment.