mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 17:08:23 +01:00
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:
@@ -4903,7 +4903,7 @@ void Spell::SendChannelStart(uint32 duration)
|
||||
{
|
||||
packet.InterruptImmunities.emplace();
|
||||
packet.InterruptImmunities->SchoolImmunities = schoolImmunityMask; // CastSchoolImmunities
|
||||
packet.InterruptImmunities->SchoolImmunities = mechanicImmunityMask; // CastImmunities
|
||||
packet.InterruptImmunities->Immunities = mechanicImmunityMask; // CastImmunities
|
||||
}
|
||||
|
||||
if (m_spellInfo->HasAttribute(SPELL_ATTR8_HEAL_PREDICTION))
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user