diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-12-12 19:35:42 -0300 |
---|---|---|
committer | DoctorKraft <DoctorKraft@users.noreply.github.com> | 2018-03-12 16:39:38 +0100 |
commit | fba0e6b2784731fcb0667fc11193c1b5a77e6e2a (patch) | |
tree | cb7c36f86ad2605f868849082b7c8351b23c38e2 /src | |
parent | 5e0e5a5573cd31e935b9f9b19311523ea0447674 (diff) |
Core/Unit: added missing nullptr check in IsImmunedToSpellEffect
Closes #18461
(cherry picked from commit 0b306936805bd670307ff343d4020fce8016a0c7)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6dbad26a75d..e7de3d5dc36 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7312,8 +7312,8 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit // Check for immune to application of harmful magical effects AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL); for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter) - if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school - (!IsFriendlyTo(caster) || !spellInfo->IsPositiveEffect(index))) // Harmful + if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school + ((caster && !IsFriendlyTo(caster)) || !spellInfo->IsPositiveEffect(index))) // Harmful return true; } } |