aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKittnz <Kittnz@users.noreply.github.com>2016-05-09 20:16:37 +0200
committerKittnz <Kittnz@users.noreply.github.com>2016-05-09 20:16:37 +0200
commit190c75c5668caae3972f061b9a1073aac219e0ef (patch)
tree6e7e63967670a3304f6e4e6646199245f22eebdc /src
parent1ad02a0d61671db707d52aa9f90d770002d6d67f (diff)
parent37b2f590b6d63f230c755f932c2dd356c265486f (diff)
Merge pull request #16476 from Eliminationzx/FixWrongTotemPlacement
[3.3.5][6.x] Core/Spells: Fix wrong totem placement
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 166eff139f4..60554e0717c 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1302,18 +1302,30 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
}
default:
{
- float dist;
+ float dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
float angle = targetType.CalcDirectionAngle();
float objSize = m_caster->GetObjectSize();
- if (targetType.GetTarget() == TARGET_DEST_CASTER_SUMMON)
- dist = PET_FOLLOW_DIST;
- else
- dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
if (dist < objSize)
dist = objSize;
- else if (targetType.GetTarget() == TARGET_DEST_CASTER_RANDOM)
- dist = objSize + (dist - objSize) * float(rand_norm());
+
+ switch (targetType.GetTarget())
+ {
+ case TARGET_DEST_CASTER_SUMMON:
+ dist = PET_FOLLOW_DIST;
+ break;
+ case TARGET_DEST_CASTER_RANDOM:
+ dist = objSize + (dist - objSize) * float(rand_norm());
+ break;
+ case TARGET_DEST_CASTER_FRONT_LEFT:
+ case TARGET_DEST_CASTER_BACK_LEFT:
+ case TARGET_DEST_CASTER_FRONT_RIGHT:
+ case TARGET_DEST_CASTER_BACK_RIGHT:
+ dist = dist + objSize;
+ break;
+ default:
+ break;
+ }
Position pos = dest._position;
m_caster->MovePositionToFirstCollision(pos, dist, angle);