diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 54381e4ae..14781986e 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -498,6 +498,22 @@ 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 && ( + hook->hook_type == MOBJ_HOOK(MobjThinker ) + || hook->hook_type == MOBJ_HOOK(MobjCollide ) + || hook->hook_type == MOBJ_HOOK(MobjLineCollide) + || hook->hook_type == MOBJ_HOOK(MobjMoveCollide) + || hook->hook_type == MOBJ_HOOK(MobjFuse ) + || hook->hook_type == MOBJ_HOOK(MobjThinker ) + || hook->hook_type == MOBJ_HOOK(BossThinker ) + || hook->hook_type == MOBJ_HOOK(MobjMoveBlocked) + || hook->hook_type == MOBJ_HOOK(FollowMobj ) + )) + LUA_UsageWarning(L, va( + "%s hooks not attached to a specific mobj type are deprecated and will be removed.", + mobjHookNames[hook->hook_type]) + ); + return call_mapped(hook, &mobjHookIds[mobj_type][hook->hook_type]); } @@ -751,7 +767,7 @@ static void hook_think_frame(int type) PS_SetThinkFrameHookInfo(hook_index, time_taken, ar.short_src); else if (type == 6) PS_SetPostThinkFrameHookInfo(hook_index, time_taken, ar.short_src); - + hook_index++; } }