aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 5ffb17d05ac..9590322617f 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1991,17 +1991,13 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
break;
}
- if(cur == TARGET_DEST_DEST)
- break;
-
- float x, y, z, angle, dist;
-
- dist = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
- if (cur == TARGET_DEST_DEST_RANDOM)
- dist *= rand_norm();
-
+ float angle;
switch(cur)
{
+ case TARGET_DEST_DYNOBJ_ENEMY:
+ case TARGET_DEST_DYNOBJ_ALLY:
+ case TARGET_DEST_DEST:
+ return;
case TARGET_DEST_DEST_FRONT: angle = 0.0f; break;
case TARGET_DEST_DEST_BACK: angle = M_PI; break;
case TARGET_DEST_DEST_RIGHT: angle = M_PI/2; break;
@@ -2013,6 +2009,11 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
default: angle = rand_norm()*2*M_PI; break;
}
+ float dist, x, y, z;
+ dist = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ if (cur == TARGET_DEST_DEST_RANDOM)
+ dist *= rand_norm();
+
x = m_targets.m_destX;
y = m_targets.m_destY;
z = m_targets.m_destZ;