Core/Unit: fix crash on magic school autoattacks

Closes #19436

(cherry picked from commit 0b50ea072e504ac7d5bf87b08d564955785f7197)
This commit is contained in:
ariel- authored and funjoker committed 2022-02-16 04:49:24 +01:00
1 parent 8746d9f56a
commit cb168a8e7e
1 file changed
+1 -1
+1 -1
View File
@@ -1725,7 +1725,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;