mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Fix crash on broken ENCHANTED bonus
This commit is contained in:
parent
9e5e7d95c3
commit
a97d1d9377
@ -584,10 +584,10 @@ void BattleFlowProcessor::stackEnchantedTrigger(const CBattleInfoCallback & batt
|
||||
auto bl = *(st->getBonuses(Selector::type()(BonusType::ENCHANTED)));
|
||||
for(auto b : bl)
|
||||
{
|
||||
const CSpell * sp = b->subtype.as<SpellID>().toSpell();
|
||||
if(!sp)
|
||||
if (!b->subtype.as<SpellID>().hasValue())
|
||||
continue;
|
||||
|
||||
const CSpell * sp = b->subtype.as<SpellID>().toSpell();
|
||||
const int32_t val = bl.valOfBonuses(Selector::typeSubtype(b->type, b->subtype));
|
||||
const int32_t level = ((val > 3) ? (val - 3) : val);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user