Changed: Possible bug if string not found
This commit is contained in:
parent
0324ebbd63
commit
4e24a6444c
1 changed files with 10 additions and 2 deletions
|
@ -604,7 +604,11 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
|
||||||
pos = newmsg.find(ucstring("}"));;
|
pos = newmsg.find(ucstring("}"));;
|
||||||
prefix += " ";
|
prefix += " ";
|
||||||
}
|
}
|
||||||
newmsg = newmsg.substr(0, pos + 1) + prefix + newmsg.substr(pos + 1);
|
|
||||||
|
if (pos == ucstring::npos)
|
||||||
|
newmsg = prefix + newmsg;
|
||||||
|
else
|
||||||
|
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
|
||||||
CCDBNodeLeaf* node = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB", false);
|
CCDBNodeLeaf* node = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB", false);
|
||||||
|
@ -615,7 +619,11 @@ 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("] "));
|
||||||
newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos);
|
|
||||||
|
if (pos == ucstring::npos)
|
||||||
|
newmsg = prefix + newmsg;
|
||||||
|
else
|
||||||
|
newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue