[10627] Use ObjectGuid for player's selection and unit's target

This commit is contained in:
VladimirMangos 2010-10-20 08:15:30 +04:00
parent e74d56f9d2
commit c955941b55
21 changed files with 66 additions and 73 deletions

View file

@ -2886,7 +2886,7 @@ void Spell::EffectJump(SpellEffectIndex eff_idx)
else if(unitTarget->getVictim())
pTarget = m_caster->getVictim();
else if(m_caster->GetTypeId() == TYPEID_PLAYER)
pTarget = m_caster->GetMap()->GetUnit(((Player*)m_caster)->GetSelection());
pTarget = m_caster->GetMap()->GetUnit(((Player*)m_caster)->GetSelectionGuid());
o = pTarget ? pTarget->GetOrientation() : m_caster->GetOrientation();
}
@ -2955,7 +2955,7 @@ void Spell::EffectTeleportUnits(SpellEffectIndex eff_idx)
else if(unitTarget->getVictim())
pTarget = unitTarget->getVictim();
else if(unitTarget->GetTypeId() == TYPEID_PLAYER)
pTarget = unitTarget->GetMap()->GetUnit(((Player*)unitTarget)->GetSelection());
pTarget = unitTarget->GetMap()->GetUnit(((Player*)unitTarget)->GetSelectionGuid());
// Init dest coordinates
float x = m_targets.m_destX;