Core/Spells: Allow TARGET_UNIT_CHANNEL_TARGET to target players

(broken in c0eb6c3130)
This commit is contained in:
joschiwald
2017-07-18 17:00:55 +02:00
parent be7486fddb
commit 8e71051de5

View File

@@ -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);
}