aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAokromes <Aokromes@users.noreply.github.com>2016-07-04 21:12:36 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-02-04 23:16:52 +0100
commit29668f732dfa2dc77a77b1ac2270b5b0662dfd4d (patch)
tree3fdf2594a568948bc73c58303b3d6333e428a55c /src
parent4c9301ca7016fc47759197280aaec23ef1923062 (diff)
Code/Battleground Opening a game object(banner) under absorb effects … (#17459)
* Code/Battleground Opening a game object(banner) under absorb effects in battlegrounds should result an interupt By zwerg, closes #6222 (cherry picked from commit d34cce1edb818425935662582fd18cc79bb77b19)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 4b19a6e2e70..3ea3305f99c 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -651,6 +651,17 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
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 != this && 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) != 0)
+ 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));