mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +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)));
|
auto bl = *(st->getBonuses(Selector::type()(BonusType::ENCHANTED)));
|
||||||
for(auto b : bl)
|
for(auto b : bl)
|
||||||
{
|
{
|
||||||
const CSpell * sp = b->subtype.as<SpellID>().toSpell();
|
if (!b->subtype.as<SpellID>().hasValue())
|
||||||
if(!sp)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
const CSpell * sp = b->subtype.as<SpellID>().toSpell();
|
||||||
const int32_t val = bl.valOfBonuses(Selector::typeSubtype(b->type, b->subtype));
|
const int32_t val = bl.valOfBonuses(Selector::typeSubtype(b->type, b->subtype));
|
||||||
const int32_t level = ((val > 3) ? (val - 3) : val);
|
const int32_t level = ((val > 3) ? (val - 3) : val);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user