Core/Spells: Fixed autoattack timer being reset by almost every spell cast

This commit is contained in:
Shauren
2026-03-03 10:33:05 +01:00
parent 59720664b3
commit d23ea9773c
3 changed files with 5 additions and 4 deletions

View File

@@ -9218,8 +9218,9 @@ void Unit::AtEnterCombat()
if (Spell* spell = m_currentSpells[CURRENT_GENERIC_SPELL])
if (spell->getState() == SPELL_STATE_PREPARING
&& spell->m_spellInfo->HasAttribute(SPELL_ATTR0_NOT_IN_COMBAT_ONLY_PEACEFUL)
&& spell->m_spellInfo->InterruptFlags.HasFlag(SpellInterruptFlags::Combat))
InterruptNonMeleeSpells(false);
&& spell->m_spellInfo->InterruptFlags.HasFlag(SpellInterruptFlags::Combat)
&& !spell->m_spellInfo->HasAura(SPELL_AURA_MOUNTED)) // for some reason mounts are not interrupted by entering combat even with both interrupt flag and attribute
InterruptSpell(CURRENT_GENERIC_SPELL, false, false);
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::EnteringCombat);
Unit::ProcSkillsAndAuras(this, nullptr, PROC_FLAG_ENTER_COMBAT, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr);

View File

@@ -8345,7 +8345,7 @@ bool Spell::IsChannelActive() const
bool Spell::IsAutoActionResetSpell() const
{
if (IsTriggered() || m_spellInfo->HasAttribute(SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS))
if (IsTriggered() || !m_spellInfo->InterruptFlags.HasFlag(SpellInterruptFlags::Combat) || m_spellInfo->HasAttribute(SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS))
return false;
if (!m_casttime && m_spellInfo->HasAttribute(SPELL_ATTR6_DOESNT_RESET_SWING_TIMER_IF_INSTANT))

View File

@@ -62,7 +62,7 @@ enum class SpellInterruptFlags : uint32
Movement = 0x00000001,
DamagePushbackPlayerOnly = 0x00000002,
Stun = 0x00000004, // useless, even spells without it get interrupted
Combat = 0x00000008,
Combat = 0x00000008, // used for both interrupting spell when entering combat and to reset auto attack timer
DamageCancelsPlayerOnly = 0x00000010,
MeleeCombat = 0x00000020, // NYI
Immunity = 0x00000040, // NYI