From 4f7aa0ed5234e0cc5cc50bd83fd725f02989f2d7 Mon Sep 17 00:00:00 2001 From: Pioooooo Date: Sat, 5 Oct 2024 22:47:29 +0800 Subject: [PATCH] Fix /help not printing help for several chat commands and improve help message --- src/game/server/ddracechat.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 1741cbe4422..77187366daa 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -113,7 +113,7 @@ void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData) { const char *pArg = pResult->GetString(0); const IConsole::CCommandInfo *pCmdInfo = - pSelf->Console()->GetCommandInfo(pArg, CFGFLAG_SERVER, false); + pSelf->Console()->GetCommandInfo(pArg, CFGFLAG_SERVER | CFGFLAG_CHAT, false); if(pCmdInfo) { if(pCmdInfo->m_pParams) @@ -127,10 +127,11 @@ void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData) pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", pCmdInfo->m_pHelp); } else - pSelf->Console()->Print( - IConsole::OUTPUT_LEVEL_STANDARD, - "chatresp", - "Command is either unknown or you have given a blank command without any parameters."); + { + char aBuf[256]; + str_format(aBuf, sizeof(aBuf), "Unknown command %s", pArg); + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", aBuf); + } } }