From 82c9e10a2aa14fba0fa2abe23d9b10ace4fc07ee Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Mon, 28 Mar 2022 22:51:41 +0200 Subject: [PATCH] Core/Spells: restore handling for src_area_x channel target selection --- src/server/game/Spells/Spell.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 149792bc93..3a4ff25c3a 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4889,12 +4889,22 @@ void Spell::SendChannelUpdate(uint32 time) void Spell::SendChannelStart(uint32 duration) { - ObjectGuid channelTarget = m_targets.GetObjectTargetGUID();; + ObjectGuid channelTarget = m_targets.GetObjectTargetGUID(); if (!channelTarget && !m_spellInfo->NeedsExplicitUnitTarget()) { // this is for TARGET_SELECT_CATEGORY_NEARBY if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID; + else + { + // We assume that when we have a channel spell with more than one unique unit target that there is a caster and a target. + // We don't want the caster but the target so we are looking for a non-caster entry within the target list + for (auto& itr : m_UniqueTargetInfo) + { + if (itr.targetGUID != m_caster->GetGUID()) + channelTarget = itr.targetGUID; + } + } } // There must always be a channel target