From 0e1cc205ef4cf54cc8380de2fa8d095da0862efd Mon Sep 17 00:00:00 2001 From: def Date: Mon, 21 Aug 2017 20:48:11 +0200 Subject: [PATCH] Fix formatting for server chat messages with time in already --- src/game/server/gamecontext.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 2ecc6897b..289fe51c7 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -2917,10 +2917,15 @@ void CGameContext::SendChatResponse(const char *pLine, void *pUser, bool Highlig return; ReentryGuard++; - if(*pLine == '[') - do - pLine++; - while((pLine - 2 < pLineOrig || *(pLine - 2) != ':') && *pLine != 0); // remove the category (e.g. [Console]: No Such Command) + if(pLine[0] == '[') + { + // Remove time and category: [20:39:00][Console] + pLine = str_find(pLine, "]: "); + if(pLine) + pLine += 3; + else + pLine = pLineOrig; + } pSelf->SendChatTarget(ClientID, pLine);