1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

fix regression of #6255

This commit is contained in:
Laserlicht
2025-10-28 12:39:28 +01:00
parent c202d44179
commit ea001c6973

View File

@@ -1678,9 +1678,12 @@ void CObjectListWindow::trimTextIfTooWide(std::string & text, bool preserveCount
{
auto posBrace = text.find_last_of("(");
auto posClosing = text.find_last_of(")");
std::string objCount = text.substr(posBrace, posClosing - posBrace) + ')';
suffix += " ";
suffix += objCount;
if (posBrace != std::string::npos && posClosing != std::string::npos && posBrace < posClosing)
{
std::string objCount = text.substr(posBrace, posClosing - posBrace) + ')';
suffix += " ";
suffix += objCount;
}
}
const auto & font = ENGINE->renderHandler().loadFont(FONT_SMALL);