aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-12-12 19:35:42 -0300
committerariel- <ariel-@users.noreply.github.com>2016-12-12 19:37:16 -0300
commit0b306936805bd670307ff343d4020fce8016a0c7 (patch)
treefc9802a0f8d82e26bde5cc24aa2b7cbfc35e38eb /src
parent45f8135ac45799e555449bebb6d2a78869a439b6 (diff)
Core/Unit: added missing nullptr check in IsImmunedToSpellEffect
Closes #18461
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
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 6fa241b39e6..f8ab62b78fb 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -8050,8 +8050,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;
}
}