forked from mirror/azerothcore-wotlk
fix(Core/Unit): prevent self-immunity in IsImmunedToSpell (#25984)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -954,6 +954,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, uint32 effectMask, Unit
|
||||
for (auto const& [immunitySchoolMask, immunityAuraId] : schoolList)
|
||||
{
|
||||
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(immunityAuraId);
|
||||
if (immunityAuraId == spellInfo->Id)
|
||||
continue;
|
||||
|
||||
if ((immunitySchoolMask & schoolMask) != schoolMask)
|
||||
continue;
|
||||
|
||||
@@ -10087,6 +10090,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
|
||||
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
{
|
||||
if (itr->second == spellInfo->Id)
|
||||
continue;
|
||||
|
||||
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
|
||||
if (!(itr->first & spellSchoolMask))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user