refactor(Core/Misc): sin() to std::sin() (#9795)

This commit is contained in:
Kitzunu
2022-01-06 19:29:40 +01:00
committed by GitHub
parent 66e6d33116
commit cb7e355291
66 changed files with 212 additions and 211 deletions

View File

@@ -824,7 +824,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[1][i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_GROUP_1_ATTACK, 3000);
@@ -850,7 +850,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[0][i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_GROUP_2_ATTACK, 3000);
@@ -875,7 +875,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[2][i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(0, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_GROUP_3_ATTACK, 3000);
@@ -900,7 +900,7 @@ public:
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
{
float angle = rand_norm() * 2 * M_PI;
c->GetMotionMaster()->MovePoint(4, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * sin(angle), 411.3f);
c->GetMotionMaster()->MovePoint(4, 748.309f + 3.0f * cos(angle), 619.448f + 3.0f * std::sin(angle), 411.3f);
}
events.ScheduleEvent(EVENT_GRAND_CHAMPIONS_MOUNTS_ATTACK, 3000);

View File

@@ -182,7 +182,7 @@ public:
{
float angle = rand_norm() * 2 * M_PI;
float dist = rand_norm() * 40.0f;
if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) )
if( Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + std::sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000) )
{
c->SetFaction(FACTION_PREY);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -652,7 +652,7 @@ public:
o -= M_PI;
else
o += M_PI;
me->NearTeleportTo(target->GetPositionX() + cos(o) * 5.0f, target->GetPositionY() + sin(o) * 5.0f, target->GetPositionZ() + 0.6f, target->GetOrientation());
me->NearTeleportTo(target->GetPositionX() + cos(o) * 5.0f, target->GetPositionY() + std::sin(o) * 5.0f, target->GetPositionZ() + 0.6f, target->GetOrientation());
AttackStart(target);
me->GetMotionMaster()->MoveChase(target);
events.DelayEvents(3000);

View File

@@ -589,9 +589,9 @@ struct boss_jormungarAI : public ScriptedAI
c->SetSpeed(MOVE_RUN, 2.5f);
c->CastSpell(c, SPELL_CHURNING_GROUND, true);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
c->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + sin(angle)*dist, me->GetPositionZ());
c->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + std::sin(angle)*dist, me->GetPositionZ());
}
me->UpdatePosition(Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), true);
me->UpdatePosition(Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + std::sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), true);
me->StopMovingOnCurrentPos();
DoResetThreat();
@@ -939,10 +939,10 @@ public:
if( angle > 1.0f && angle < 2.0f ) // near main gate
dist = 46.0f;
destX = Locs[LOC_CENTER].GetPositionX() + cos(angle) * dist;
destY = Locs[LOC_CENTER].GetPositionY() + sin(angle) * dist;
destY = Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * dist;
destZ = Locs[LOC_CENTER].GetPositionZ() + 1.0f;
me->StopMoving();
me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX() + cos(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionY() + sin(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionZ() + 1.0f, 40.0f, 12.0f);
me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX() + cos(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionZ() + 1.0f, 40.0f, 12.0f);
events.RescheduleEvent(EVENT_TRAMPLE, 1500);

View File

@@ -319,7 +319,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
for( uint8 i = 0; i < count; ++i )
{
float angle = rand_norm() * 2 * M_PI;
if( Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500) )
if( Creature* ball = me->SummonCreature((i % 2) ? NPC_CONCENTRATED_DARK : NPC_CONCENTRATED_LIGHT, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, Locs[LOC_CENTER].GetPositionZ() + 1.5f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1500) )
boss_twin_valkyrAI::JustSummoned(ball);
}
@@ -718,7 +718,7 @@ public:
void MoveToNextPoint()
{
float angle = rand_norm() * 2 * M_PI;
me->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + sin(angle) * 47.0f, me->GetPositionZ());
me->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX() + cos(angle) * 47.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * 47.0f, me->GetPositionZ());
}
void UpdateAI(uint32 /*diff*/) override