aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 2f870eb2cee..d39691e5a9c 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -7872,9 +7872,20 @@ void Spell::DelayedChannel()
m_timer -= delaytime;
for (TargetInfo const& targetInfo : m_UniqueTargetInfo)
- if (targetInfo.MissCondition == SPELL_MISS_NONE)
- if (Unit* unit = (unitCaster->GetGUID() == targetInfo.TargetGUID) ? unitCaster : ObjectAccessor::GetUnit(*unitCaster, targetInfo.TargetGUID))
- unit->DelayOwnedAuras(m_spellInfo->Id, m_originalCasterGUID, delaytime);
+ {
+ if (targetInfo.MissCondition != SPELL_MISS_NONE)
+ continue;
+
+ Unit* unit = unitCaster;
+ if (unitCaster->GetGUID() != targetInfo.TargetGUID)
+ {
+ unit = ObjectAccessor::GetUnit(*unitCaster, targetInfo.TargetGUID);
+ if (!unit)
+ continue;
+ }
+
+ unit->DelayOwnedAuras(m_spellInfo->Id, m_originalCasterGUID, delaytime);
+ }
// partially interrupt persistent area auras
if (DynamicObject* dynObj = unitCaster->GetDynObject(m_spellInfo->Id))