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:
Xanadu
2010-03-18 20:41:38 +01:00
parent aca2d26bc5
commit 06d4918163

View File

@@ -2002,6 +2002,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
Position pos;
m_caster->GetNearPosition(pos, dist, angle);
m_targets.setDst(&pos); // also flag
AddUnitTarget(m_caster, i);
break;
}
@@ -2017,6 +2018,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
if(cur == TARGET_DST_TARGET_ENEMY || cur == TARGET_DEST_TARGET_ANY)
{
m_targets.setDst(target);
AddUnitTarget(target, i);
break;
}
@@ -2045,6 +2047,9 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
Position pos;
target->GetNearPosition(pos, dist, angle);
m_targets.setDst(&pos);
// Teleports use this as destination
if (m_spellInfo->Effect[i] != SPELL_EFFECT_TELEPORT_UNITS)
AddUnitTarget(target, i);
break;
}