Core/Unit: fix crash on magic school autoattacks

Closes #19436
This commit is contained in:
ariel-
2017-04-10 12:17:08 -03:00
parent e565b34f6d
commit 0b50ea072e

View File

@@ -1763,7 +1763,7 @@ float Unit::CalculateAverageResistReduction(SpellSchoolMask schoolMask, Unit con
victimResistance = std::max(victimResistance, 0.0f);
// level-based resistance does not apply to binary spells, and cannot be overcome by spell penetration
if (!spellInfo->HasAttribute(SPELL_ATTR0_CU_BINARY_SPELL))
if (!spellInfo || !spellInfo->HasAttribute(SPELL_ATTR0_CU_BINARY_SPELL))
victimResistance += std::max((float(victim->getLevelForTarget(this)) - float(getLevelForTarget(victim))) * 5.0f, 0.0f);
static uint32 const BOSS_LEVEL = 83;