feat(Core/Misc): change how Position struct is retrieved (#9017)

Update Position::GetPosition() and similar methods signatures to reflect 2a4c9bc changes by return a Position object instead of accepting a Position parameter by reference.

Cherry pick of 2585e799f9
This commit is contained in:
sschepens
2021-11-10 19:43:00 -03:00
committed by GitHub
parent d31d8279ca
commit b7f8083915
36 changed files with 68 additions and 133 deletions

View File

@@ -364,8 +364,7 @@ public:
{
if (spell->Id == SPELL_DRAW_SPIRIT && target->GetTypeId() == TYPEID_PLAYER)
{
Position targetPos;
target->GetPosition(&targetPos);
Position targetPos = target->GetPosition();
me->SummonCreature(NPC_SPIRIT_SHADE, targetPos, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
}
}

View File

@@ -140,8 +140,7 @@ bool NPCStaveQuestAI::ValidThreatlist()
void NPCStaveQuestAI::SetHomePosition()
{
Position homePosition;
me->GetPosition(&homePosition);
Position homePosition = me->GetPosition();
if (homePosition.IsPositionValid())
{
@@ -564,8 +563,7 @@ public:
void RespawnPet()
{
Position current;
me->GetNearPosition(current, -5.0f, 0.0f);
Position current = me->GetNearPosition(-5.0f, 0.0f);
Precious()->RemoveCorpse(false, false);
Precious()->SetPosition(current);
Precious()->SetHomePosition(current);
@@ -609,8 +607,7 @@ public:
return;
}
Position petResetPos;
me->GetNearPosition(petResetPos, -5.0f, 0.0f);
Position petResetPos = me->GetNearPosition(-5.0f, 0.0f);
if (petResetPos.IsPositionValid())
{