PrintToChat/PrintToCenter natives will now break out of displaying if FormatString throws an error
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401023
This commit is contained in:
parent
1d2f3a9cd5
commit
5e7b7589be
@ -278,6 +278,12 @@ static cell_t PrintToChat(IPluginContext *pContext, const cell_t *params)
|
||||
char buffer[192];
|
||||
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||
|
||||
/* Check for an error before printing to the client */
|
||||
if (pContext->GetContext()->n_err != SP_ERROR_NONE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_HL2.TextMsg(client, HUD_PRINTTALK, buffer);
|
||||
|
||||
return 1;
|
||||
@ -303,6 +309,12 @@ static cell_t PrintCenterText(IPluginContext *pContext, const cell_t *params)
|
||||
char buffer[192];
|
||||
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||
|
||||
/* Check for an error before printing to the client */
|
||||
if (pContext->GetContext()->n_err != SP_ERROR_NONE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_HL2.TextMsg(client, HUD_PRINTCENTER, buffer);
|
||||
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user