Lua: Hook PlayerMsg to code, remove vestigial mute variable from it¨

This commit is contained in:
JugadorXEI 2025-08-15 19:54:46 +02:00 committed by NepDisk
parent 90026bc683
commit 0e53d5dfd7
3 changed files with 5 additions and 3 deletions

View file

@ -650,6 +650,9 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
}
}
if (LUA_HookPlayerMsg(playernum, target, flags, msg))
return;
// If it's a CSAY, just CECHO and be done with it.
if (flags & HU_CSAY)
{

View file

@ -164,7 +164,7 @@ int LUA_HookMobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8
int LUA_HookMobjMoveBlocked(mobj_t *, mobj_t *, line_t *);
void LUA_HookSpecialExecute(activator_t *activator, INT32 *args, char **stringargs);
void LUA_HookLinedefExecute(line_t *, mobj_t *, sector_t *);
int LUA_HookPlayerMsg(int source, int target, int flags, char *msg, int mute);
int LUA_HookPlayerMsg(int source, int target, int flags, char *msg);
int LUA_HookHurtMsg(player_t *, mobj_t *inflictor, mobj_t *source, UINT8 damagetype);
int LUA_HookMapThingSpawn(mobj_t *, mapthing_t *);
int LUA_HookFollowMobj(player_t *, mobj_t *);

View file

@ -951,7 +951,7 @@ void LUA_HookSpecialExecute(activator_t *activator, INT32 *args, char **stringar
}
}
int LUA_HookPlayerMsg(int source, int target, int flags, char *msg, int mute)
int LUA_HookPlayerMsg(int source, int target, int flags, char *msg)
{
Hook_State hook = {};
if (prepare_hook(&hook, false, HOOK(PlayerMsg)))
@ -971,7 +971,6 @@ int LUA_HookPlayerMsg(int source, int target, int flags, char *msg, int mute)
LUA_PushUserdata(gL, &players[target-1], META_PLAYER); // target
}
lua_pushstring(gL, msg); // msg
lua_pushboolean(gL, mute); // the message was supposed to be eaten by spamprotecc.
call_hooks(&hook, 1, res_true);
}