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)

View File

@@ -155,8 +155,7 @@ public:
_phase = PHASE_GROUND;
SetCombatMovement(true);
me->SetCanFly(false);
Position VictimPos;
me->GetVictim()->GetPosition(&VictimPos);
Position VictimPos = me->GetVictim()->GetPosition();
me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
DoResetThreat();
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
@@ -208,8 +207,7 @@ public:
break;
case EVENT_SUMMON_SWARMER:
{
Position Pos;
me->GetRandomPoint(SwarmerPos, 80.0f, Pos);
Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f);
me->SummonCreature(NPC_SWARMER, Pos);
events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000);
break;

View File

@@ -146,8 +146,7 @@ public:
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
{
Position Point;
me->GetRandomPoint(RoomCenter, RoomRadius, Point);
Position Point = me->GetRandomPoint(RoomCenter, RoomRadius);
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
}

View File

@@ -462,8 +462,7 @@ public:
Talk(CAPITIVE_SAY, owner);
_playerGUID = owner->GetGUID();
}
Position pos;
me->GetNearPosition(pos, 3.0f, 0.0f);
Position pos = me->GetNearPosition(3.0f, 0.0f);
me->GetMotionMaster()->MovePoint(POINT_INIT, pos);
}