aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKandera <KanderaDev@gmail.com>2012-05-14 15:14:40 -0400
committerKandera <KanderaDev@gmail.com>2012-05-14 15:24:48 -0400
commitcd06bb93773b9e788067e1a73bbd75ad01937c64 (patch)
treee3b2e8c6b30fe180fde3ee87ab706aeae719636c
parent06e019b72225e824711fc41b6f4d0443b715b8cc (diff)
Core/Spells: fix possible crash from not having any effect and trying to check if immune. fixes non effect spell mechanic checking for spells with both spell mechanics and effect mechanics
-rwxr-xr-xsrc/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 3c10243e6b1..bf4911223b8 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -11569,7 +11569,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
}
// Spells that don't have effectMechanics.
- if (!spellInfo->HasAnyEffectMechanic() && spellInfo->Mechanic)
+ if (spellInfo->Mechanic)
{
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
@@ -11609,7 +11609,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const
{
- if (!spellInfo)
+ if (!spellInfo || !spellInfo->Effects[index])
return false;
// If m_immuneToEffect type contain this effect type, IMMUNE effect.
uint32 effect = spellInfo->Effects[index].Effect;