Added unit targets for TARGET_TYPE_DEST_TARGET and TARGET_TYPE_DEST_CASTER to tackle the cases where unit targets are required but there is no other implicit target to produce them (like in 53, 0 combination).
This works in conjunction with my next commit. --HG-- branch : trunk
This commit is contained in:
@@ -2002,6 +2002,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
|||||||
Position pos;
|
Position pos;
|
||||||
m_caster->GetNearPosition(pos, dist, angle);
|
m_caster->GetNearPosition(pos, dist, angle);
|
||||||
m_targets.setDst(&pos); // also flag
|
m_targets.setDst(&pos); // also flag
|
||||||
|
AddUnitTarget(m_caster, i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2017,6 +2018,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
|||||||
if(cur == TARGET_DST_TARGET_ENEMY || cur == TARGET_DEST_TARGET_ANY)
|
if(cur == TARGET_DST_TARGET_ENEMY || cur == TARGET_DEST_TARGET_ANY)
|
||||||
{
|
{
|
||||||
m_targets.setDst(target);
|
m_targets.setDst(target);
|
||||||
|
AddUnitTarget(target, i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2045,6 +2047,9 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
|||||||
Position pos;
|
Position pos;
|
||||||
target->GetNearPosition(pos, dist, angle);
|
target->GetNearPosition(pos, dist, angle);
|
||||||
m_targets.setDst(&pos);
|
m_targets.setDst(&pos);
|
||||||
|
// Teleports use this as destination
|
||||||
|
if (m_spellInfo->Effect[i] != SPELL_EFFECT_TELEPORT_UNITS)
|
||||||
|
AddUnitTarget(target, i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user