mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Fix name in chat not being highlighted (Closed #2190)
The message "xfoo foo" did not highlight for player "foo" now it does.
This commit is contained in:
parent
20cb02048d
commit
ac0621a062
|
@ -552,14 +552,16 @@ void CChat::OnMessage(int MsgType, void *pRawMsg)
|
|||
|
||||
bool CChat::LineShouldHighlight(const char *pLine, const char *pName)
|
||||
{
|
||||
const char *pHL = str_utf8_find_nocase(pLine, pName);
|
||||
const char *pHit = str_utf8_find_nocase(pLine, pName);
|
||||
|
||||
if(pHL)
|
||||
while(pHit)
|
||||
{
|
||||
int Length = str_length(pName);
|
||||
|
||||
if(Length > 0 && (pLine == pHL || pHL[-1] == ' ') && (pHL[Length] == 0 || pHL[Length] == ' ' || pHL[Length] == '.' || pHL[Length] == '!' || pHL[Length] == ',' || pHL[Length] == '?' || pHL[Length] == ':'))
|
||||
if(Length > 0 && (pLine == pHit || pHit[-1] == ' ') && (pHit[Length] == 0 || pHit[Length] == ' ' || pHit[Length] == '.' || pHit[Length] == '!' || pHit[Length] == ',' || pHit[Length] == '?' || pHit[Length] == ':'))
|
||||
return true;
|
||||
|
||||
pHit = str_utf8_find_nocase(pHit + 1, pName);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue