fix(Core/Player): Interrupt flag capturing even if damage is absorbed. (#9445)

This commit is contained in:
Branel
2021-12-16 13:43:09 +01:00
committed by GitHub
parent 1331fd03e5
commit cac265525c

View File

@@ -816,6 +816,25 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
else
victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, 0);
// interrupt spells with SPELL_INTERRUPT_FLAG_ABORT_ON_DMG on absorbed damage (no dots)
if (!damage && damagetype != DOT && cleanDamage && cleanDamage->absorbed_damage)
{
if (victim != attacker && victim->GetTypeId() == TYPEID_PLAYER)
{
if (Spell* spell = victim->m_currentSpells[CURRENT_GENERIC_SPELL])
{
if (spell->getState() == SPELL_STATE_PREPARING)
{
uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
if (interruptFlags & SPELL_INTERRUPT_FLAG_ABORT_ON_DMG)
{
victim->InterruptNonMeleeSpells(false);
}
}
}
}
}
// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
AuraEffectList vCopyDamageCopy(victim->GetAuraEffectsByType(SPELL_AURA_SHARE_DAMAGE_PCT));