From 8ac954a7f92655e8d47b009f4502f6e2c7589025 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sat, 23 Oct 2010 08:58:48 +0000 Subject: [PATCH] Fixed crash with damage calculation. --- lib/CGameState.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index e2a904f16..fa021ab12 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -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 (affectedCreature) //Hero specials like Solmyr, Deemer + ret *= (100.f + ((caster->valOfBonuses(Bonus::SPECIAL_SPELL_LEV, sp->id) * caster->level) / affectedCreature->type->level)) / 100.0f; } - if (caster) //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; }