Add missing GetFunctionCount check in ChatTriggers::OnSayCommand_Pre (bug 5864, r=kyles).
This commit is contained in:
parent
a2aa5d1cda
commit
3d11742f91
@ -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 || \
|
||||||
@ -437,10 +434,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