From 06d491816357a045d72c9aa1a8a63cc2c77c83d5 Mon Sep 17 00:00:00 2001 From: Xanadu Date: Thu, 18 Mar 2010 20:41:38 +0100 Subject: 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 --- src/game/Spell.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 88d22b63164..b71d4bb7c1e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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; } -- cgit v1.2.3