hooklib: move HurtMsg to mobj hooks

Fixes regression of mobj type discriminator not working
for this hook.

blame 8d382e49fb
This commit is contained in:
James R 2022-12-31 04:25:52 -08:00
parent a895a5c374
commit fbcdaa6f4d
2 changed files with 2 additions and 2 deletions

View file

@ -41,6 +41,7 @@ automatically.
X (MobjMoveBlocked),/* P_XYMovement (when movement is blocked) */\
X (MapThingSpawn),/* P_SpawnMapThing */\
X (FollowMobj),/* P_PlayerAfterThink Smiles mobj-following */\
X (HurtMsg),/* imhurttin */\
#define HOOK_LIST(X) \
X (NetVars),/* add to archive table (netsave) */\
@ -56,7 +57,6 @@ automatically.
X (JumpSpinSpecial),/* P_DoJumpStuff (Spin button effect (mid-air)) */\
X (BotTiccmd),/* B_BuildTiccmd */\
X (PlayerMsg),/* chat messages */\
X (HurtMsg),/* imhurttin */\
X (PlayerSpawn),/* G_SpawnPlayer */\
X (ShieldSpawn),/* P_SpawnShieldOrb */\
X (ShieldSpecial),/* shield abilities */\

View file

@ -933,7 +933,7 @@ int LUA_HookPlayerMsg(int source, int target, int flags, char *msg)
int LUA_HookHurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
{
Hook_State hook;
if (prepare_hook(&hook, false, HOOK(HurtMsg)))
if (prepare_mobj_hook(&hook, false, MOBJ_HOOK(HurtMsg), inflictor))
{
LUA_PushUserdata(gL, player, META_PLAYER);
LUA_PushUserdata(gL, inflictor, META_MOBJ);