1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-05 00:49:09 +02:00

fix text for spell school bonus

This commit is contained in:
Laserlicht
2024-12-22 19:11:16 +01:00
parent 2272707175
commit c68db70405
4 changed files with 18 additions and 3 deletions

View File

@ -84,6 +84,13 @@ std::string CBonusTypeHandler::bonusToString(const std::shared_ptr<Bonus> & bonu
if (text.find("${subtype.spell}") != std::string::npos && bonus->subtype.as<SpellID>().hasValue())
boost::algorithm::replace_all(text, "${subtype.spell}", bonus->subtype.as<SpellID>().toSpell()->getNameTranslated());
if (text.find("${subtype.spellSchool}") != std::string::npos && bonus->subtype.as<SpellSchool>().hasValue())
{
auto school = bonus->subtype.as<SpellSchool>();
auto schoolName = VLC->generaltexth->zelp[school == SpellSchool::ANY ? 458 : 454 + school].first;
boost::algorithm::replace_all(text, "${subtype.spellSchool}", schoolName);
}
return text;
}