From 697509bd68642053fbd64d41119ad8b850329940 Mon Sep 17 00:00:00 2001 From: LJ Sonic Date: Tue, 24 Sep 2024 23:26:54 +0200 Subject: [PATCH] Fix global mobj hooks deprecation warning always triggering --- src/lua_hooklib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 51ebe3938..1bf3caf65 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -498,7 +498,9 @@ static int call_string_hooks(Hook_State *hook) static int call_mobj_type_hooks(Hook_State *hook, mobjtype_t mobj_type) { - if (mobj_type == MT_NULL && ( + int numCalls = call_mapped(hook, &mobjHookIds[mobj_type][hook->hook_type]); + + if (numCalls > 0 && mobj_type == MT_NULL && ( hook->hook_type == MOBJ_HOOK(MobjThinker ) || hook->hook_type == MOBJ_HOOK(MobjCollide ) || hook->hook_type == MOBJ_HOOK(MobjLineCollide) @@ -514,7 +516,7 @@ static int call_mobj_type_hooks(Hook_State *hook, mobjtype_t mobj_type) mobjHookNames[hook->hook_type]) ); - return call_mapped(hook, &mobjHookIds[mobj_type][hook->hook_type]); + return numCalls; } static void call_hud_hooks