aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index a8ceedd970e..d2fa8650c13 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2129,7 +2129,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
pos = *destTarget;
else
// randomize position for multiple summons
- m_caster->GetRandomPoint(*destTarget, radius, pos);
+ pos = m_caster->GetRandomPoint(*destTarget, radius);
summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration);
if (!summon)
@@ -4305,9 +4305,8 @@ void Spell::EffectLeap(SpellEffIndex /*effIndex*/)
if (!m_targets.HasDst())
return;
- Position pos;
- destTarget->GetPosition(&pos);
- unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f);
+ Position pos = destTarget->GetPosition();
+ pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f);
unitTarget->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), unitTarget == m_caster);
}
@@ -4445,9 +4444,8 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
// Spell is not using explicit target - no generated path
if (m_preGeneratedPath.GetPathType() == PATHFIND_BLANK)
{
- Position pos;
- unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
- unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster));
+ //unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
+ Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster));
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
}
else
@@ -4469,11 +4467,10 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
if (m_targets.HasDst())
{
- Position pos;
- destTarget->GetPosition(&pos);
+ Position pos = destTarget->GetPosition();
float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY());
float dist = m_caster->GetDistance(pos);
- m_caster->GetFirstCollisionPosition(pos, dist, angle);
+ pos = m_caster->GetFirstCollisionPosition(dist, angle);
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
}
@@ -5406,7 +5403,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
pos = *destTarget;
else
// randomize position for multiple summons
- m_caster->GetRandomPoint(*destTarget, radius, pos);
+ pos = m_caster->GetRandomPoint(*destTarget, radius);
TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id);
if (!summon)
@@ -5650,10 +5647,7 @@ void Spell::EffectBind(SpellEffIndex effIndex)
if (m_targets.HasDst())
homeLoc.WorldRelocate(*destTarget);
else
- {
- player->GetPosition(&homeLoc);
- homeLoc.m_mapId = player->GetMapId();
- }
+ homeLoc = player->GetWorldLocation();
player->SetHomebind(homeLoc, areaId);
@@ -5737,9 +5731,9 @@ void Spell::EffectCreateAreaTrigger(SpellEffIndex effIndex)
Position pos;
if (!m_targets.HasDst())
- GetCaster()->GetPosition(&pos);
+ pos = GetCaster()->GetPosition();
else
- destTarget->GetPosition(&pos);
+ pos = destTarget->GetPosition();
// trigger entry/miscvalue relation is currently unknown, for now use MiscValue as trigger entry
uint32 triggerEntry = GetSpellInfo()->Effects[effIndex].MiscValue;