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

Signed-off-by: luis <[email protected]>
This commit is contained in:
Shauren
2026-03-03 19:37:55 -03:00
committed by luis
parent 2fdb0b4233
commit d67801df7f
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -9234,8 +9234,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);
+1 -1
View File
@@ -8357,7 +8357,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))
+1 -1
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