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

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12642" #define REVISION_NR "12643"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__