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

@@ -381,7 +381,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
float rand = 8 + rand_norm() * 12;
float angle = rand_norm() * 2 * M_PI;
float x = 1201.8f + rand * cos(angle);
float y = -4299.6f + rand * sin(angle);
float y = -4299.6f + rand * std::sin(angle);
if (Creature* cr = me->SummonCreature(NPC_MOLE_MACHINE_TRIGGER, x, y, 21.3f, 0.0f))
cr->CastSpell(cr, SPELL_SPAWN_MOLE_MACHINE, true);
}
@@ -390,7 +390,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
float rand = rand_norm() * 20;
float angle = rand_norm() * 2 * M_PI;
float x = -5157.1f + rand * cos(angle);
float y = -598.98f + rand * sin(angle);
float y = -598.98f + rand * std::sin(angle);
if (Creature* cr = me->SummonCreature(NPC_MOLE_MACHINE_TRIGGER, x, y, 398.11f, 0.0f))
cr->CastSpell(cr, SPELL_SPAWN_MOLE_MACHINE, true);
}
@@ -422,7 +422,7 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
thrown = 0;
sayer->Say("SOMEONE TRY THIS SUPER BREW!", LANG_UNIVERSAL);
//sayer->CastSpell(sayer, SPELL_CREATE_SUPER_BREW, true);
sayer->SummonCreature(NPC_SUPER_BREW_TRIGGER, sayer->GetPositionX() + 15 * cos(sayer->GetOrientation()), sayer->GetPositionY() + 15 * sin(sayer->GetOrientation()), sayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
sayer->SummonCreature(NPC_SUPER_BREW_TRIGGER, sayer->GetPositionX() + 15 * cos(sayer->GetOrientation()), sayer->GetPositionY() + 15 * std::sin(sayer->GetOrientation()), sayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
}
else
{

View File

@@ -187,7 +187,7 @@ struct npc_winterfin_playmate : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_1);
timer = 3000;
break;
@@ -273,7 +273,7 @@ struct npc_snowfall_glade_playmate : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_1);
timer = 5000;
break;
@@ -362,7 +362,7 @@ struct npc_the_biggest_tree : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
timer = 2000;
break;
case 2:
@@ -436,7 +436,7 @@ struct npc_high_oracle_soo_roo : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_5);
timer = 3000;
break;
@@ -512,7 +512,7 @@ struct npc_elder_kekek : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_4);
timer = 3000;
break;
@@ -588,7 +588,7 @@ struct npc_the_etymidian : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_7);
timer = 5000;
break;
@@ -697,7 +697,7 @@ struct npc_alexstraza_the_lifebinder : public ScriptedAI
switch (phase)
{
case 1:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_11);
timer = 5000;
break;
@@ -728,7 +728,7 @@ struct npc_alexstraza_the_lifebinder : public ScriptedAI
Reset();
return;
case 7:
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + std::sin(me->GetOrientation()) * 5, me->GetPositionZ());
orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_11);
timer = 5000;
break;

View File

@@ -165,7 +165,7 @@ class spell_winter_veil_racer_rocket_slam : public SpellScript
{
Position pos;
float x = caster->GetPositionX() + 30 * cos(caster->GetOrientation());
float y = caster->GetPositionY() + 30 * sin(caster->GetOrientation());
float y = caster->GetPositionY() + 30 * std::sin(caster->GetOrientation());
pos.Relocate(x, y, caster->GetMap()->GetHeight(x, y, MAX_HEIGHT) + 0.5f);
//caster->GetFirstCollisionPosition(pos, 30.0f, caster->GetOrientation());
caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RACER_CHARGE_TO_OBJECT, true);