diff --git a/src/hu_stuff.c b/src/hu_stuff.c index a62058d53..60fa08249 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -705,6 +705,9 @@ static void Got_Saycmd(const 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) diff --git a/src/lua_hook.h b/src/lua_hook.h index 24e2ebf25..13d19447d 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -137,7 +137,7 @@ int LUA_HookMobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 int LUA_HookMobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype); int LUA_HookMobjMoveBlocked(mobj_t *, mobj_t *, line_t *); void LUA_HookSpecialExecute(activator_t *activator, INT32 *args, char **stringargs); -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 *); diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index ad6254a7b..0bdb83bdb 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -842,7 +842,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))) @@ -862,7 +862,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); }