Added MobjMoveBlocked Lua hook

Also slightly edited P_XYMovement to properly check the mobj still exists before checking its eflags for MFE_SPRUNG, while I was at it
This commit is contained in:
Monster Iestyn 2017-01-21 23:49:18 +00:00
parent 930527a3d6
commit e3ded1671c
3 changed files with 24 additions and 7 deletions

View file

@ -56,6 +56,7 @@ const char *const hookNames[hook_MAX+1] = {
"PlayerSpawn",
"ShieldSpawn",
"ShieldSpecial",
"MobjMoveBlocked",
NULL
};
@ -126,6 +127,7 @@ static int lib_addHook(lua_State *L)
case hook_BossDeath:
case hook_MobjRemoved:
case hook_HurtMsg:
case hook_MobjMoveBlocked:
hook.s.mt = MT_NULL;
if (lua_isnumber(L, 2))
hook.s.mt = lua_tonumber(L, 2);
@ -184,6 +186,7 @@ static int lib_addHook(lua_State *L)
case hook_MobjDeath:
case hook_BossDeath:
case hook_MobjRemoved:
case hook_MobjMoveBlocked:
lastp = &mobjhooks[hook.s.mt];
break;
case hook_JumpSpecial: