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

@@ -233,8 +233,7 @@ public:
}
else
{
Position pos;
me->GetRandomNearPosition(pos, 40);
Position pos = me->GetRandomNearPosition(40);
me->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
}

View File

@@ -301,8 +301,7 @@ public:
if (!instance->GetPlayers().isEmpty())
if (Player* player = instance->GetPlayers().getFirst()->GetSource())
{
Position pos;
player->GetPosition(&pos);
Position pos = player->GetPosition();
if (Creature* cr = instance->SummonCreature(NPC_CHROMIE_MIDDLE, pos))
{
cr->SetVisible(false);

View File

@@ -268,8 +268,7 @@ public:
break;
}
Position pos;
rift->GetNearPosition(pos, 10.0f, 2 * M_PI * rand_norm());
Position pos = rift->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
if (TempSummon* summon = instance->SummonCreature(abs(entry), pos))
{

View File

@@ -323,8 +323,7 @@ public:
void DoSummonAtRift(uint32 entry)
{
Position pos;
me->GetNearPosition(pos, 10.0f, 2 * M_PI * rand_norm());
Position pos = me->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 150000))
if (instance)