mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Also highlight name of dummy
This commit is contained in:
parent
266ead772d
commit
78d29e3301
|
@ -339,14 +339,23 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
|
|||
m_aLines[m_CurrentLine].m_NameColor = -2;
|
||||
|
||||
// check for highlighted name
|
||||
const char *pHL = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName);
|
||||
const char *pHL = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->Client()->m_LocalIDs[0]].m_aName);
|
||||
if(pHL)
|
||||
{
|
||||
int Length = str_length(m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName);
|
||||
int Length = str_length(m_pClient->m_aClients[m_pClient->Client()->m_LocalIDs[0]].m_aName);
|
||||
if((pLine == pHL || pHL[-1] == ' ') && (pHL[Length] == 0 || pHL[Length] == ' ' || pHL[Length] == '.' || pHL[Length] == '!' || pHL[Length] == ',' || pHL[Length] == '?' || pHL[Length] == ':'))
|
||||
Highlighted = true;
|
||||
}
|
||||
m_aLines[m_CurrentLine].m_Highlighted = Highlighted;
|
||||
|
||||
pHL = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->Client()->m_LocalIDs[1]].m_aName);
|
||||
if(pHL)
|
||||
{
|
||||
int Length = str_length(m_pClient->m_aClients[m_pClient->Client()->m_LocalIDs[1]].m_aName);
|
||||
if((pLine == pHL || pHL[-1] == ' ') && (pHL[Length] == 0 || pHL[Length] == ' ' || pHL[Length] == '.' || pHL[Length] == '!' || pHL[Length] == ',' || pHL[Length] == '?' || pHL[Length] == ':'))
|
||||
Highlighted = true;
|
||||
}
|
||||
|
||||
m_aLines[m_CurrentLine].m_Highlighted = Highlighted;
|
||||
|
||||
if(ClientID == -1) // server message
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue