Core/Misc: Change how Position struct is retrieved
Update Position::GetPosition() and similar methods signatures to reflect 2a4c9bcaf9 changes by return a Position object instead of accepting a Position parameter by reference.
This commit is contained in:
1 parent
dc8a7a6fa5
commit
2585e799f9
51 files changed
+102
-158
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user