diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index aa4a08f83..405941786 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -901,6 +901,7 @@ int LUA_HookMobjMoveBlocked(mobj_t *t1, mobj_t *t2, line_t *line) return hook.status; } +// Backwards Compatability For older scripts void LUA_HookLinedefExecute(line_t *line, mobj_t *mo, sector_t *sector) { Hook_State hook; @@ -922,6 +923,13 @@ void LUA_HookLinedefExecute(line_t *line, mobj_t *mo, sector_t *sector) void LUA_HookSpecialExecute(activator_t *activator, INT32 *args, char **stringargs) { Hook_State hook; + + if (activator->line) + { + // Run the old hook if possible. + LUA_HookLinedefExecute(activator->line, activator->mo, activator->sector); + } + if (prepare_string_hook (&hook, 0, STRING_HOOK(SpecialExecute), stringargs[0])) { diff --git a/src/p_spec.c b/src/p_spec.c index f737be3e1..dacb5b66f 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3459,12 +3459,7 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha if (stringargs[0]) { - if (line && mo && callsec) - { - // Allow running the old hook as well. - LUA_HookLinedefExecute(line, mo, callsec); - } - + // Also executes the old hook as well. LUA_HookSpecialExecute(activator, args, stringargs); } else