aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-05-19 14:41:23 +0200
committerOvahlord <dreadkiller@gmx.de>2025-05-26 20:49:49 +0200
commit5b3d7604e5706de37ec21ba27972ec49fc76febb (patch)
tree753d5d444d7e0f95cd00ec477d776a8b21641076 /src/server/game/Spells/Spell.cpp
parent5e2fb0d52085e29dbaec29be08b0381cca8e2b09 (diff)
Core/Misc: Silence some statis analysis false positive warnings
(cherry picked from commit fe788a5eeb0bc8600ec877d9062614b9bfc43a64)
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))