Add missing GetFunctionCount check in ChatTriggers::OnSayCommand_Pre (bug 5864, r=kyles).
--HG-- extra : rebase_source : afa6969f8319c80b027c4ae81e6b8db6b8d5c14f
This commit is contained in:
parent
5999b50e10
commit
bc789d7c1a
@ -304,15 +304,12 @@ void ChatTriggers::OnSayCommand_Pre()
|
|||||||
m_bTriggerWasSilent = is_silent;
|
m_bTriggerWasSilent = is_silent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pOnClientSayCmd->GetFunctionCount() != 0)
|
cell_t res = CallOnClientSayCommand(client);
|
||||||
{
|
|
||||||
cell_t res = CallOnClientSayCommand(client);
|
|
||||||
|
|
||||||
if (res >= Pl_Handled)
|
if (res >= Pl_Handled)
|
||||||
{
|
{
|
||||||
m_bPluginIgnored = (res >= Pl_Stop);
|
m_bPluginIgnored = (res >= Pl_Stop);
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_bWillProcessInPost || \
|
if (m_bWillProcessInPost || \
|
||||||
@ -443,10 +440,13 @@ bool ChatTriggers::PreProcessTrigger(edict_t *pEdict, const char *args, bool is_
|
|||||||
cell_t ChatTriggers::CallOnClientSayCommand(int client)
|
cell_t ChatTriggers::CallOnClientSayCommand(int client)
|
||||||
{
|
{
|
||||||
cell_t res = Pl_Continue;
|
cell_t res = Pl_Continue;
|
||||||
m_pOnClientSayCmd->PushCell(client);
|
if (m_pOnClientSayCmd->GetFunctionCount() != 0)
|
||||||
m_pOnClientSayCmd->PushString(m_Arg0Backup);
|
{
|
||||||
m_pOnClientSayCmd->PushString(m_ArgSBackup);
|
m_pOnClientSayCmd->PushCell(client);
|
||||||
m_pOnClientSayCmd->Execute(&res);
|
m_pOnClientSayCmd->PushString(m_Arg0Backup);
|
||||||
|
m_pOnClientSayCmd->PushString(m_ArgSBackup);
|
||||||
|
m_pOnClientSayCmd->Execute(&res);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user