[c12643] Correct logic when setting SPELL_FLAG_REDIRECTED

This commit is contained in:
Dramacydal 2013-06-17 10:52:52 +01:00 committed by Antz
parent c3eccda44d
commit b835736923
2 changed files with 12 additions and 6 deletions

View file

@ -1895,9 +1895,12 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
{
if (Unit* pUnitTarget = m_caster->SelectMagnetTarget(m_targets.getUnitTarget(), this, effIndex))
{
m_targets.setUnitTarget(pUnitTarget);
m_spellFlags |= SPELL_FLAG_REDIRECTED;
targetUnitMap.push_back(pUnitTarget);
if (m_targets.getUnitTarget() != pUnitTarget)
{
m_targets.setUnitTarget(pUnitTarget);
m_spellFlags |= SPELL_FLAG_REDIRECTED;
targetUnitMap.push_back(pUnitTarget);
}
}
}
else
@ -2459,8 +2462,11 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
{
if (Unit* pUnitTarget = m_caster->SelectMagnetTarget(m_targets.getUnitTarget(), this, effIndex))
{
m_targets.setUnitTarget(pUnitTarget);
m_spellFlags |= SPELL_FLAG_REDIRECTED;
if (m_targets.getUnitTarget() != pUnitTarget)
{
m_targets.setUnitTarget(pUnitTarget);
m_spellFlags |= SPELL_FLAG_REDIRECTED;
}
targetUnitMap.push_back(pUnitTarget);
}
break;