Skip to content

Commit

Permalink
Attacking Cancels flag should be checked at end of spell casts too.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Apr 13, 2024
1 parent d7a3e46 commit 5d6c3e1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
@@ -4076,7 +4076,22 @@ void Spell::cast(bool skipCheck)

// Remove any remaining invis auras on cast completion, should only be gnomish cloaking device
if (!m_IsTriggeredSpell && m_casterUnit)
m_casterUnit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_ACTION_CANCELS_LATE, m_spellInfo->Id, false, !ShouldRemoveStealthAuras(), m_spellInfo->HasAttribute(SPELL_ATTR_EX2_ALLOW_WHILE_INVISIBLE));
{
uint32 interruptFlags = AURA_INTERRUPT_ACTION_CANCELS_LATE;

// World of Warcraft Client Patch 1.7.0 (2005-09-13)
// - Only spells and abilities that target enemy units will cancel the World Enlarger effect.
// This aura has auraInterruptFlags = 4096 implying this flag triggers on negative spell casts.
// Confirmed on classic that its removed at the end of the cast with Aimed Shot.
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_6_1
if (Spells::IsExplicitNegativeTarget(m_spellInfo->EffectImplicitTargetA[0]))
#else
if (Spells::IsExplicitlySelectedUnitTarget(m_spellInfo->EffectImplicitTargetA[0]) && m_casterUnit != m_targets.getUnitTarget())
#endif
interruptFlags |= AURA_INTERRUPT_ATTACKING_CANCELS;

m_casterUnit->RemoveAurasWithInterruptFlags(interruptFlags, m_spellInfo->Id, false, !ShouldRemoveStealthAuras(), m_spellInfo->HasAttribute(SPELL_ATTR_EX2_ALLOW_WHILE_INVISIBLE));
}

TakePower();
TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot

0 comments on commit 5d6c3e1

Please sign in to comment.