mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Fixed crash with damage calculation.
This commit is contained in:
parent
c10dac929d
commit
8ac954a7f9
@ -3552,9 +3552,10 @@ ui32 BattleInfo::calculateSpellBonus(ui32 baseDamage, const CSpell * sp, const C
|
||||
ret *= (100.0f + caster->valOfBonuses(Bonus::WATER_SPELL_DMG_PREMY)) / 100.0f;
|
||||
else if(sp->earth)
|
||||
ret *= (100.0f + caster->valOfBonuses(Bonus::EARTH_SPELL_DMG_PREMY)) / 100.0f;
|
||||
}
|
||||
if (caster) //Hero specials like Solmyr, Deemer
|
||||
|
||||
if (affectedCreature) //Hero specials like Solmyr, Deemer
|
||||
ret *= (100.f + ((caster->valOfBonuses(Bonus::SPECIAL_SPELL_LEV, sp->id) * caster->level) / affectedCreature->type->level)) / 100.0f;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user