mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Lua: Hook PlayerMsg to code, remove vestigial mute variable from it¨
This commit is contained in:
parent
294e60bf8d
commit
c4464fa87c
3 changed files with 5 additions and 3 deletions
|
|
@ -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 it's a CSAY, just CECHO and be done with it.
|
||||||
if (flags & HU_CSAY)
|
if (flags & HU_CSAY)
|
||||||
|
|
|
||||||
|
|
@ -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_HookMobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype);
|
||||||
int LUA_HookMobjMoveBlocked(mobj_t *, mobj_t *, line_t *);
|
int LUA_HookMobjMoveBlocked(mobj_t *, mobj_t *, line_t *);
|
||||||
void LUA_HookSpecialExecute(activator_t *activator, INT32 *args, char **stringargs);
|
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_HookHurtMsg(player_t *, mobj_t *inflictor, mobj_t *source, UINT8 damagetype);
|
||||||
int LUA_HookMapThingSpawn(mobj_t *, mapthing_t *);
|
int LUA_HookMapThingSpawn(mobj_t *, mapthing_t *);
|
||||||
int LUA_HookFollowMobj(player_t *, mobj_t *);
|
int LUA_HookFollowMobj(player_t *, mobj_t *);
|
||||||
|
|
|
||||||
|
|
@ -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;
|
Hook_State hook;
|
||||||
if (prepare_hook(&hook, false, HOOK(PlayerMsg)))
|
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_PushUserdata(gL, &players[target-1], META_PLAYER); // target
|
||||||
}
|
}
|
||||||
lua_pushstring(gL, msg); // msg
|
lua_pushstring(gL, msg); // msg
|
||||||
lua_pushboolean(gL, mute); // the message was supposed to be eaten by spamprotecc.
|
|
||||||
|
|
||||||
call_hooks(&hook, 1, res_true);
|
call_hooks(&hook, 1, res_true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue