mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user