aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2017-07-18 17:00:55 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-07-18 17:00:55 +0200
commit8e71051de5964435bb7d01ae7267217bbbea68e9 (patch)
treed32654b07b8f98939525150560d38458f768d514
parentbe7486fddb180dac66362a7ea4e0d330b6f27d37 (diff)
Core/Spells: Allow TARGET_UNIT_CHANNEL_TARGET to target players
(broken in c0eb6c313053d2437abf2e7fff9ab50645c98559)
-rw-r--r--src/server/game/Spells/Spell.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 37cc368c4d8..02aca63a6fb 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -990,8 +990,9 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa
WorldObject* target = ObjectAccessor::GetUnit(*m_caster, channelTarget);
CallScriptObjectTargetSelectHandlers(target, effIndex, targetType);
// unit target may be no longer avalible - teleported out of map for example
- if (target && target->GetTypeId() == TYPEID_UNIT)
- AddUnitTarget(target->ToUnit(), 1 << effIndex);
+ Unit* unitTarget = target ? target->ToUnit() : nullptr;
+ if (unitTarget)
+ AddUnitTarget(unitTarget, 1 << effIndex);
else
TC_LOG_DEBUG("spells", "SPELL: cannot find channel spell target for spell ID %u, effect %u", m_spellInfo->Id, effIndex);
}