1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #4662 from Laserlicht/string_color

fixes string colorization bug
This commit is contained in:
Ivan Savenko 2024-09-24 16:29:41 +03:00 committed by GitHub
commit 88f3e982e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,7 +125,14 @@ std::vector<std::string> CMessage::breakText(std::string text, size_t maxLineWid
if(currPos < text.length() && (text[currPos] != 0x0a))
{
if(wordBreak != ui32(-1))
{
currPos = wordBreak;
if(text.substr(0, currPos).find('{') == std::string::npos)
{
opened = false;
color = "";
}
}
else
currPos -= symbolSize;
}