fix(Core/Player): Interrupt flag capturing even if damage is absorbed. (#9445)
This commit is contained in:
@@ -816,6 +816,25 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
|||||||
else
|
else
|
||||||
victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, 0);
|
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
|
// 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
|
// Let's copy the list so we can prevent iterator invalidation
|
||||||
AuraEffectList vCopyDamageCopy(victim->GetAuraEffectsByType(SPELL_AURA_SHARE_DAMAGE_PCT));
|
AuraEffectList vCopyDamageCopy(victim->GetAuraEffectsByType(SPELL_AURA_SHARE_DAMAGE_PCT));
|
||||||
|
|||||||
Reference in New Issue
Block a user