Core/Misc: Silence some statis analysis false positive warnings

This commit is contained in:
Shauren
2025-05-19 14:41:23 +02:00
parent de5f2ff798
commit fe788a5eeb
4 changed files with 25 additions and 14 deletions

View File

@@ -8137,9 +8137,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))