From a5ac879cea896c81bddfa016d1b1d0987f975c6d Mon Sep 17 00:00:00 2001 From: Lactozilla <jp6781615@gmail.com> Date: Mon, 14 Aug 2023 21:36:06 -0300 Subject: [PATCH] Ensure hook status is initialized properly --- src/lua_hooklib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 26d3569d66..3c5e7889fd 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -318,6 +318,8 @@ static boolean init_hook_type const char * string, int nonzero ){ + memset(&hook->status, 0, sizeof(hook->status)); + hook->status.type_int = status; if (nonzero) @@ -1322,7 +1324,7 @@ static void res_playerspawnpoint(Hook_State *hook) spawnpoint_t *LUA_HookPlayerSpawnPoint(player_t *player) { Hook_State hook; - if (prepare_hook(&hook, -1, HOOK(PlayerSpawnPoint))) + if (prepare_hook(&hook, 0, HOOK(PlayerSpawnPoint))) { LUA_PushUserdata(gL, player, META_PLAYER); call_hooks(&hook, 8, res_playerspawnpoint); -- GitLab