mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-30 04:40:53 +00:00
Changed: Possible bug if string not found
This commit is contained in:
parent
df3cdfab70
commit
bb5dc2c471
1 changed files with 10 additions and 2 deletions
|
@ -604,6 +604,10 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
|
||||||
pos = newmsg.find(ucstring("}"));;
|
pos = newmsg.find(ucstring("}"));;
|
||||||
prefix += " ";
|
prefix += " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos == ucstring::npos)
|
||||||
|
newmsg = prefix + newmsg;
|
||||||
|
else
|
||||||
newmsg = newmsg.substr(0, pos + 1) + prefix + newmsg.substr(pos + 1);
|
newmsg = newmsg.substr(0, pos + 1) + prefix + newmsg.substr(pos + 1);
|
||||||
|
|
||||||
// Add dynchannel number and optionally name before text if user channel
|
// Add dynchannel number and optionally name before text if user channel
|
||||||
|
@ -615,6 +619,10 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
|
||||||
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
|
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
|
||||||
prefix = title.empty() ? ucstring("") : ucstring(" ") + title;
|
prefix = title.empty() ? ucstring("") : ucstring(" ") + title;
|
||||||
pos = newmsg.find(ucstring("] "));
|
pos = newmsg.find(ucstring("] "));
|
||||||
|
|
||||||
|
if (pos == ucstring::npos)
|
||||||
|
newmsg = prefix + newmsg;
|
||||||
|
else
|
||||||
newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos);
|
newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue