Merge pull request #7992 from furo321/no-cmdlist-rcon

Don't tell user about `/cmdlist` in rcon when using an unknown command.
This commit is contained in:
archimede67 2024-02-18 18:15:02 +00:00 committed by GitHub
commit 8a98e70172
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -547,7 +547,10 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, bo
if(!m_pfnUnknownCommandCallback(pStr, m_pUnknownCommandUserdata)) if(!m_pfnUnknownCommandCallback(pStr, m_pUnknownCommandUserdata))
{ {
char aBuf[CMDLINE_LENGTH + 32]; char aBuf[CMDLINE_LENGTH + 32];
if(m_FlagMask & CFGFLAG_CHAT)
str_format(aBuf, sizeof(aBuf), "No such command: %s. Use /cmdlist for a list of all commands.", Result.m_pCommand); str_format(aBuf, sizeof(aBuf), "No such command: %s. Use /cmdlist for a list of all commands.", Result.m_pCommand);
else
str_format(aBuf, sizeof(aBuf), "No such command: %s.", Result.m_pCommand);
Print(OUTPUT_LEVEL_STANDARD, "chatresp", aBuf); Print(OUTPUT_LEVEL_STANDARD, "chatresp", aBuf);
} }
} }