aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-04-25 21:19:30 +0200
committerjackpoz <giacomopoz@gmail.com>2014-04-25 21:19:30 +0200
commit2585e799f95f259dd4b422daf15ef7963173c408 (patch)
tree96335cb3da64afc64af4ad3c3e994f441059832d /src/server/game/Spells/SpellEffects.cpp
parentdc8a7a6fa5a3afb8f95958db2bdc0888361e56f8 (diff)
Core/Misc: Change how Position struct is retrieved
Update Position::GetPosition() and similar methods signatures to reflect 2a4c9bcaf910430cdf3070987ce085da3c2666da changes by return a Position object instead of accepting a Position parameter by reference.
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 35930906307..775f6540944 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2292,7 +2292,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)
@@ -4593,9 +4593,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);
}
@@ -4732,9 +4731,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
@@ -4756,11 +4754,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);
}
@@ -5688,7 +5685,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)
@@ -5909,10 +5906,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);