mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
refactor(Core/Misc): sin() to std::sin() (#9795)
This commit is contained in:
@@ -130,7 +130,7 @@ public:
|
||||
if (Creature* boss = instance->GetCreature(NPC_DevourerGUID))
|
||||
{
|
||||
float angle = boss->GetAngle(leader);
|
||||
leader->GetMotionMaster()->MovePoint(1, boss->GetPositionX() + 10.0f * cos(angle), boss->GetPositionY() + 10.0f * sin(angle), boss->GetPositionZ());
|
||||
leader->GetMotionMaster()->MovePoint(1, boss->GetPositionX() + 10.0f * cos(angle), boss->GetPositionY() + 10.0f * std::sin(angle), boss->GetPositionZ());
|
||||
}
|
||||
|
||||
for (int8 i = 0; outroPositions[i].entry[teamIdInInstance] != 0; ++i)
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
Position myPos(*me), exitPos;
|
||||
float ang = me->GetOrientation() + 3 * M_PI / 2;
|
||||
float dist = 3.0f;
|
||||
exitPos.Relocate(myPos.GetPositionX() + dist * cos(ang), myPos.GetPositionY() + dist * sin(ang), 515.0f, M_PI);
|
||||
exitPos.Relocate(myPos.GetPositionX() + dist * cos(ang), myPos.GetPositionY() + dist * std::sin(ang), 515.0f, M_PI);
|
||||
exitPos.m_positionZ = me->GetMap()->GetHeight(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ());
|
||||
|
||||
if (exitPos.GetPositionZ() < 505.0f || exitPos.GetPositionZ() > 512.0f || !me->IsWithinLOS(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.GetPositionZ()))
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
float angle = me->GetAngle(c);
|
||||
me->SetFacingTo(angle);
|
||||
float x = me->GetPositionX() + cos(angle) * 7.0f;
|
||||
float y = me->GetPositionY() + sin(angle) * 7.0f;
|
||||
float y = me->GetPositionY() + std::sin(angle) * 7.0f;
|
||||
c->GetMotionMaster()->MovePoint(0, x, y, me->GetPositionZ());
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
c->SendMovementFlagUpdate();
|
||||
float dist = rand_norm() * 2.0f;
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
c->GetMotionMaster()->MoveTakeoff(0, c->GetPositionX() + dist * cos(angle), c->GetPositionY() + dist * sin(angle), c->GetPositionZ() + 6.0f + (float)urand(0, 4), 1.5f + frand(0.0f, 1.5f));
|
||||
c->GetMotionMaster()->MoveTakeoff(0, c->GetPositionX() + dist * cos(angle), c->GetPositionY() + dist * std::sin(angle), c->GetPositionZ() + 6.0f + (float)urand(0, 4), 1.5f + frand(0.0f, 1.5f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
c->SetSpeed(MOVE_RUN, 0.8f);
|
||||
c->SetInCombatWithZone();
|
||||
c->GetMotionMaster()->MoveChase(me, dist, angle);
|
||||
c->SetHomePosition(me->GetPositionX() + dist * cos(angle), me->GetPositionY() + dist * sin(angle), me->GetPositionZ(), 0.0f);
|
||||
c->SetHomePosition(me->GetPositionX() + dist * cos(angle), me->GetPositionY() + dist * std::sin(angle), me->GetPositionZ(), 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
{
|
||||
float angle = c->GetAngle(me);
|
||||
float x = c->GetPositionX() + cos(angle) * 12.0f;
|
||||
float y = c->GetPositionY() + sin(angle) * 12.0f;
|
||||
float y = c->GetPositionY() + std::sin(angle) * 12.0f;
|
||||
me->GetMotionMaster()->MovePoint(2, x, y, c->GetPositionZ());
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ public:
|
||||
me->SetFacingTo(PTSTyrannusWaitPos2.GetOrientation());
|
||||
break;
|
||||
case 5:
|
||||
me->GetMotionMaster()->MoveTakeoff(10, me->GetPositionX() + 2.0f * cos(me->GetOrientation()), me->GetPositionY() + 2.0f * sin(me->GetOrientation()), me->GetPositionZ() + 30.0f, 7.0f);
|
||||
me->GetMotionMaster()->MoveTakeoff(10, me->GetPositionX() + 2.0f * cos(me->GetOrientation()), me->GetPositionY() + 2.0f * std::sin(me->GetOrientation()), me->GetPositionZ() + 30.0f, 7.0f);
|
||||
break;
|
||||
case 6:
|
||||
me->GetMotionMaster()->MovePoint(4, PTSTyrannusWaitPos3, false);
|
||||
@@ -979,7 +979,7 @@ public:
|
||||
c->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CHEER);
|
||||
float ang = frand(1.92f, 2.36f);
|
||||
float dist = urand(50, 85);
|
||||
c->GetMotionMaster()->MovePoint(0, TSSpawnPos.GetPositionX() + cos(ang)*dist, TSSpawnPos.GetPositionY() + sin(ang)*dist, 628.2f);
|
||||
c->GetMotionMaster()->MovePoint(0, TSSpawnPos.GetPositionX() + cos(ang)*dist, TSSpawnPos.GetPositionY() + std::sin(ang)*dist, 628.2f);
|
||||
}
|
||||
}
|
||||
else if (p == 3)
|
||||
@@ -1187,7 +1187,7 @@ public:
|
||||
{
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
float dist = urand(1, 4);
|
||||
target->ToPlayer()->NearTeleportTo(me->GetPositionX() + cos(angle)*dist, me->GetPositionY() + sin(angle)*dist, me->GetPositionZ(), me->GetOrientation());
|
||||
target->ToPlayer()->NearTeleportTo(me->GetPositionX() + cos(angle)*dist, me->GetPositionY() + std::sin(angle)*dist, me->GetPositionZ(), me->GetOrientation());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user