[10385] Remove Unit::GetUnit and update it callers.

This commit is contained in:
VladimirMangos 2010-08-20 16:51:52 +04:00
parent dcc9dc25ae
commit 77ae9a63b8
7 changed files with 40 additions and 50 deletions

View file

@ -4336,8 +4336,7 @@ SpellCastResult Spell::CheckCast(bool strict)
}
else if (m_caster == target)
{
if (m_caster->GetTypeId() == TYPEID_PLAYER) // Target - is player caster
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->IsInWorld())
{
// Additional check for some spells
// If 0 spell effect empty - client not send target data (need use selection)
@ -4345,7 +4344,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
m_spellInfo->EffectImplicitTargetA[EFFECT_INDEX_1] == TARGET_CHAIN_DAMAGE)
{
if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
if (target = m_caster->GetMap()->GetUnit(((Player *)m_caster)->GetSelection()))
m_targets.setUnitTarget(target);
else
return SPELL_FAILED_BAD_TARGETS;