mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
refactor(Core/Misc): sin() to std::sin() (#9795)
This commit is contained in:
@@ -1722,7 +1722,7 @@ public:
|
||||
if (Position* dest = const_cast<WorldLocation*>(GetExplTargetDest()))
|
||||
{
|
||||
float angle = dest->GetAngle(GetCaster());
|
||||
Position offset = {6.0f * cos(angle), 6.0f * sin(angle), 10.0f, 0.0f};
|
||||
Position offset = {6.0f * cos(angle), 6.0f * std::sin(angle), 10.0f, 0.0f};
|
||||
dest->RelocateOffset(offset);
|
||||
GetCaster()->UpdateAllowedPositionZ(dest->GetPositionX(), dest->GetPositionY(), dest->m_positionZ);
|
||||
}
|
||||
@@ -1762,7 +1762,7 @@ public:
|
||||
for (uint8 i = 6; i > 0; --i)
|
||||
{
|
||||
float destX = summoner->GetPositionX() + cos(angle + a * M_PI) * i * 10.0f;
|
||||
float destY = summoner->GetPositionY() + sin(angle + a * M_PI) * i * 10.0f;
|
||||
float destY = summoner->GetPositionY() + std::sin(angle + a * M_PI) * i * 10.0f;
|
||||
if (summoner->GetMap()->isInLineOfSight(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ() + 10.0f, destX, destY, summoner->GetPositionZ() + 10.0f, summoner->GetPhaseMask(), LINEOFSIGHT_ALL_CHECKS) && destX > 4585.0f && destY > 2716.0f && destY < 2822.0f)
|
||||
{
|
||||
float destZ = summoner->GetMapHeight(summoner->GetPhaseMask(), destX, destY, summoner->GetPositionZ());
|
||||
|
||||
@@ -339,7 +339,7 @@ public:
|
||||
me->DisableSpline();
|
||||
me->CastSpell(me, SPELL_COLDFLAME_SUMMON, true);
|
||||
float nx = me->GetPositionX() + 5.0f * cos(me->GetOrientation());
|
||||
float ny = me->GetPositionY() + 5.0f * sin(me->GetOrientation());
|
||||
float ny = me->GetPositionY() + 5.0f * std::sin(me->GetOrientation());
|
||||
if (!me->IsWithinLOS(nx, ny, 42.5f))
|
||||
{
|
||||
break;
|
||||
@@ -495,12 +495,12 @@ public:
|
||||
float dist = caster->GetObjectSize() / 2.0f;
|
||||
float z = caster->GetPositionZ() + 2.5f;
|
||||
float nx = caster->GetPositionX() + dist * cos(angle);
|
||||
float ny = caster->GetPositionY() + dist * sin(angle);
|
||||
float ny = caster->GetPositionY() + dist * std::sin(angle);
|
||||
|
||||
if (!caster->IsWithinLOS(nx, ny, z))
|
||||
{
|
||||
nx = caster->GetPositionX() + 0.5f * cos(angle);
|
||||
ny = caster->GetPositionY() + 0.5f * sin(angle);
|
||||
ny = caster->GetPositionY() + 0.5f * std::sin(angle);
|
||||
}
|
||||
|
||||
if (caster->IsWithinLOS(nx, ny, z))
|
||||
@@ -599,7 +599,7 @@ public:
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
float nx = x + 2.5f * cos((M_PI / 4) + (i * (M_PI / 2)));
|
||||
float ny = y + 2.5f * sin((M_PI / 4) + (i * (M_PI / 2)));
|
||||
float ny = y + 2.5f * std::sin((M_PI / 4) + (i * (M_PI / 2)));
|
||||
if (caster->IsWithinLOS(nx, ny, z))
|
||||
{
|
||||
caster->m_orientation = (M_PI / 4) + (i * (M_PI / 2));
|
||||
|
||||
@@ -2541,7 +2541,7 @@ public:
|
||||
me->CastSpell((Unit*)nullptr, SPELL_EJECT_ALL_PASSENGERS, false);
|
||||
float dist = rand_norm() * 10.0f + 5.0f;
|
||||
float angle = CenterPosition.GetAngle(me);
|
||||
_destPoint.Relocate(CenterPosition.GetPositionX() + dist * cos(angle), CenterPosition.GetPositionY() + dist * sin(angle), 855.0f + frand(0.0f, 4.0f), 0.0f);
|
||||
_destPoint.Relocate(CenterPosition.GetPositionX() + dist * cos(angle), CenterPosition.GetPositionY() + dist * std::sin(angle), 855.0f + frand(0.0f, 4.0f), 0.0f);
|
||||
me->SetHomePosition(_destPoint);
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_MOVE_TO_SIPHON_POS, 0);
|
||||
@@ -2773,7 +2773,7 @@ public:
|
||||
{
|
||||
float dist = 2.0f + rand_norm() * 18.0f;
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
Position const offset = {dist * cos(angle), dist * sin(angle), 0.0f, 0.0f};
|
||||
Position const offset = {dist * cos(angle), dist * std::sin(angle), 0.0f, 0.0f};
|
||||
WorldLocation* dest = const_cast<WorldLocation*>(GetExplTargetDest());
|
||||
dest->RelocateOffset(offset);
|
||||
GetHitDest()->RelocateOffset(offset);
|
||||
@@ -3232,7 +3232,7 @@ public:
|
||||
float angle = lichKing->GetAngle(me);
|
||||
Movement::PointsArray path;
|
||||
path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
|
||||
path.push_back(G3D::Vector3(lichKing->GetPositionX() + dist * cos(angle), lichKing->GetPositionY() + dist * sin(angle), 843.0f));
|
||||
path.push_back(G3D::Vector3(lichKing->GetPositionX() + dist * cos(angle), lichKing->GetPositionY() + dist * std::sin(angle), 843.0f));
|
||||
me->GetMotionMaster()->MoveSplinePath(&path);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1158,7 +1158,7 @@ public:
|
||||
float startAngle = 3 * M_PI / 2;
|
||||
float maxAddAngle = ((target->GetMap()->GetSpawnMode() % 2) == 0 ? M_PI : 2 * M_PI);
|
||||
float angle = startAngle + rand_norm() * maxAddAngle;
|
||||
target->CastSpell(target->GetPositionX() + cos(angle)*dist, target->GetPositionY() + sin(angle)*dist, target->GetPositionZ(), spellId, true);
|
||||
target->CastSpell(target->GetPositionX() + cos(angle)*dist, target->GetPositionY() + std::sin(angle)*dist, target->GetPositionZ(), spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -3215,7 +3215,7 @@ public:
|
||||
float angle = who->GetAngle(me);
|
||||
float dist = 3.0f;
|
||||
pos.m_positionX += cos(angle) * dist;
|
||||
pos.m_positionY += sin(angle) * dist;
|
||||
pos.m_positionY += std::sin(angle) * dist;
|
||||
me->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 10.0f, 6.0f, 0);
|
||||
}
|
||||
}
|
||||
@@ -3462,7 +3462,7 @@ public:
|
||||
{
|
||||
float dist = frand(18.0f, 39.0f);
|
||||
float o = rand_norm() * 2 * M_PI;
|
||||
if (Creature* broodling = me->SummonCreature(NPC_NERUBAR_BROODLING, me->GetPositionX() + cos(o) * dist, me->GetPositionY() + sin(o) * dist, 250.0f, Position::NormalizeOrientation(o - M_PI)))
|
||||
if (Creature* broodling = me->SummonCreature(NPC_NERUBAR_BROODLING, me->GetPositionX() + cos(o) * dist, me->GetPositionY() + std::sin(o) * dist, 250.0f, Position::NormalizeOrientation(o - M_PI)))
|
||||
{
|
||||
broodling->CastSpell(broodling, SPELL_WEB_BEAM2, false);
|
||||
broodling->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, broodling->GetPositionX(), broodling->GetPositionY(), 213.03f, false);
|
||||
|
||||
Reference in New Issue
Block a user