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:
@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user