diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 52453c1368c..66fff844a20 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1145,12 +1145,12 @@ bool SpellInfo::HasOnlyDamageEffects() const return true; } -bool SpellInfo::CanBeInterrupted(Unit* interruptTarget) const +bool SpellInfo::CanBeInterrupted(Unit* interruptTarget, bool ignoreImmunity /*= false*/) const { return HasAttribute(SPELL_ATTR7_CAN_ALWAYS_BE_INTERRUPTED) || HasChannelInterruptFlag(SpellAuraInterruptFlags::Damage | SpellAuraInterruptFlags::EnteringCombat) || (interruptTarget->IsPlayer() && InterruptFlags.HasFlag(SpellInterruptFlags::DamageCancelsPlayerOnly)) - || (!(interruptTarget->GetMechanicImmunityMask() & (1 << MECHANIC_INTERRUPT)) + || ((!(interruptTarget->GetMechanicImmunityMask() & (1 << MECHANIC_INTERRUPT)) || ignoreImmunity) && PreventionType & SPELL_PREVENTION_TYPE_SILENCE); } @@ -3315,17 +3315,10 @@ uint32 SpellInfo::GetAllowedMechanicMask() const uint32 SpellInfo::GetMechanicImmunityMask(Unit* caster) const { - bool canBeInterrupted = [&]() - { - return HasAttribute(SPELL_ATTR7_CAN_ALWAYS_BE_INTERRUPTED) - || HasChannelInterruptFlag(SpellAuraInterruptFlags::Damage | SpellAuraInterruptFlags::EnteringCombat) - || (caster->IsPlayer() && InterruptFlags.HasFlag(SpellInterruptFlags::DamageCancelsPlayerOnly)) - || PreventionType & SPELL_PREVENTION_TYPE_SILENCE; - }(); - uint32 casterMechanicImmunityMask = caster->GetMechanicImmunityMask(); uint32 mechanicImmunityMask = 0; - if (canBeInterrupted) + + if (CanBeInterrupted(caster, true)) { if (casterMechanicImmunityMask & (1 << MECHANIC_INTERRUPT)) mechanicImmunityMask |= (1 << MECHANIC_INTERRUPT); diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index c54106c4c0b..b884f68e462 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -489,7 +489,7 @@ class TC_GAME_API SpellInfo inline bool HasAttribute(SpellAttr10 attribute) const { return !!(AttributesEx10 & attribute); } inline bool HasAttribute(SpellCustomAttributes customAttribute) const { return !!(AttributesCu & customAttribute); } - bool CanBeInterrupted(Unit* interruptTarget) const; + bool CanBeInterrupted(Unit* interruptTarget, bool ignoreImmunity = false) const; bool HasAnyAuraInterruptFlag() const; bool HasAuraInterruptFlag(SpellAuraInterruptFlags flag) const { return AuraInterruptFlags.HasFlag(flag); }