Core/Spells: corrected a check when retrieving mechanic immunities in cast and channel packets and fixed a typo in SMSG_CHANNEL_START that was overwriting school immunities with mechanic immunities instead

This commit is contained in:
Ovahlord committed 2021-04-27 15:42:50 +02:00
1 parent 3da9d31690
commit bf28dfcf0c
2 files changed
+9 -4

No files matched your search

+8 -3
View File
@@ -3280,12 +3280,17 @@ uint32 SpellInfo::GetAllowedMechanicMask() const
uint32 SpellInfo::GetMechanicImmunityMask(Unit* caster) const
{
if (HasAttribute(SPELL_ATTR7_CAN_ALWAYS_BE_INTERRUPTED))
return 0;
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(caster))
if (canBeInterrupted)
{
if (casterMechanicImmunityMask & (1 << MECHANIC_INTERRUPT))
mechanicImmunityMask |= (1 << MECHANIC_INTERRUPT);