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

@@ -62,8 +62,7 @@ public:
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_me->SetReactState(REACT_PASSIVE);
Position movePos;
_me->GetRandomPoint(OrcsRunawayPosition, 10.0f, movePos);
Position movePos = _me->GetRandomPoint(OrcsRunawayPosition, 10.0f);
_me->GetMotionMaster()->MovePoint(1, movePos);
return true;
}

View File

@@ -272,8 +272,7 @@ public:
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
{
Position pos;
target->GetFirstCollisionPosition(pos, 5.0f, M_PI);
Position pos = target->GetFirstCollisionPosition(5.0f, M_PI);
GetCaster()->CastSpell(target, SPELL_GARROTE_DUMMY, true);
GetCaster()->RemoveAurasDueToSpell(SPELL_VANISH);
GetCaster()->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), target->GetOrientation());

View File

@@ -299,7 +299,7 @@ public:
if ((me->GetMapId() == 532))
{
me->GetRandomNearPosition(pos, 40.0);
pos = me->GetRandomNearPosition(40.0);
}
else
{

View File

@@ -778,8 +778,7 @@ public:
if (MoveTimer <= diff)
{
Position pos;
me->GetRandomNearPosition(pos, 10);
Position pos = me->GetRandomNearPosition(10);
me->GetMotionMaster()->MovePoint(0, pos);
MoveTimer = urand(3000, 5000);
}

View File

@@ -318,8 +318,7 @@ public:
// emerge cast tr false 66947
case EVENT_SPAWN_WAVE_1:
{
Position spawnPos;
c->GetPosition(&spawnPos);
Position spawnPos = c->GetPosition();
spawnPos.m_orientation = 5.80f;
spawnPos.m_positionX += 5.0f * cos(4.5f);
spawnPos.m_positionY += 5.0f * sin(4.5f);
@@ -333,8 +332,7 @@ public:
break;
case EVENT_SPAWN_WAVE_2:
{
Position spawnPos;
c->GetPosition(&spawnPos);
Position spawnPos = c->GetPosition();
spawnPos.m_orientation = 5.80f;
spawnPos.m_positionX += 7.0f * cos(4.0f);
spawnPos.m_positionY += 7.0f * sin(4.0f);
@@ -349,8 +347,7 @@ public:
break;
case EVENT_SPAWN_WAVE_3:
{
Position spawnPos;
c->GetPosition(&spawnPos);
Position spawnPos = c->GetPosition();
spawnPos.m_orientation = 5.80f;
spawnPos.m_positionX += 8.0f * cos(4.0f);
spawnPos.m_positionY += 8.0f * sin(4.0f);