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

Fix loading of spell immunity icons for corresponding bonus

This commit is contained in:
Ivan Savenko
2025-04-10 22:24:22 +03:00
parent 0b437e8b1d
commit e51ba74214
3 changed files with 10 additions and 4 deletions

View File

@ -96,6 +96,12 @@ ImagePath CBonusTypeHandler::bonusToGraphics(const std::shared_ptr<Bonus> & bonu
{
const CBonusType & bt = bonusTypes[vstd::to_underlying(bonus->type)];
if (bonus->type == BonusType::SPELL_IMMUNITY && bonus->subtype.as<SpellID>().hasValue())
{
const CSpell * sp = bonus->subtype.as<SpellID>().toSpell();
return sp->getIconImmune();
}
if (bt.subtypeIcons.count(bonus->subtype.getNum()))
return bt.subtypeIcons.at(bonus->subtype.getNum());