Merge pull request #8605 from MilkeeyCat/pr_remove_multiline_client_support

Remove multi line chat support
This commit is contained in:
Robert Müller 2024-07-17 12:12:49 +00:00 committed by GitHub
commit 06d16158ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -660,13 +660,11 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
if(pEnd != 0) if(pEnd != 0)
*(const_cast<char *>(pEnd)) = 0; *(const_cast<char *>(pEnd)) = 0;
bool Highlighted = false; if(*pLine == 0)
char *p = const_cast<char *>(pLine);
// Only empty string left
if(*p == 0)
return; return;
bool Highlighted = false;
auto &&FChatMsgCheckAndPrint = [this](CLine *pLine_) { auto &&FChatMsgCheckAndPrint = [this](CLine *pLine_) {
if(pLine_->m_ClientId < 0) // server or client message if(pLine_->m_ClientId < 0) // server or client message
{ {
@ -699,20 +697,6 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, pLine_->m_Whisper ? "whisper" : (pLine_->m_Team ? "teamchat" : "chat"), aBuf, ChatLogColor); Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, pLine_->m_Whisper ? "whisper" : (pLine_->m_Team ? "teamchat" : "chat"), aBuf, ChatLogColor);
}; };
while(*p)
{
Highlighted = false;
pLine = p;
// find line separator and strip multiline
while(*p)
{
if(*p++ == '\n')
{
*(p - 1) = 0;
break;
}
}
CLine *pCurrentLine = &m_aLines[m_CurrentLine]; CLine *pCurrentLine = &m_aLines[m_CurrentLine];
// Team Number: // Team Number:
@ -836,7 +820,6 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
} }
FChatMsgCheckAndPrint(pCurrentLine); FChatMsgCheckAndPrint(pCurrentLine);
}
// play sound // play sound
int64_t Now = time(); int64_t Now = time();