mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[c12643] Correct logic when setting SPELL_FLAG_REDIRECTED
This commit is contained in:
parent
c3eccda44d
commit
b835736923
2 changed files with 12 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue