fix(Core/Unit): partial immunity for mixed spells (#25219)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
sogladev 2026-03-25 12:42:25 +01:00 committed by GitHub
parent 9d9f9bdc58
commit aac930864a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 58 additions and 3 deletions

View file

@ -910,15 +910,34 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, uint32 effectMask, Unit
if (!spellInfo)
return false;
bool immuneToAllEffects = true;
bool hasCheckedEffect = false;
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!(effectMask & (1u << i)))
continue;
if (!spellInfo->Effects[i].IsEffect())
continue;
hasCheckedEffect = true;
if (IsImmunedToSpellEffect(spellInfo, i, caster))
return true;
{
if (spellInfo->HasAttribute(SPELL_ATTR4_NO_PARTIAL_IMMUNITY))
return true;
continue;
}
immuneToAllEffects = false;
break;
}
if (hasCheckedEffect && immuneToAllEffects)
return true;
if (!spellInfo->HasAttribute(SPELL_ATTR2_NO_SCHOOL_IMMUNITIES))
{
if (IsImmunedToSchool(spellInfo))