mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Random: Changed random functions returning doubles to return floats
* They were all cast to float at use anyway * Improves roll_chance_f performance (rand32() is now called internally by uniform_real_distribution once instead of twice)
This commit is contained in:
@@ -307,7 +307,7 @@ class spell_midsummer_fling_torch : public SpellScript
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Position dest = GetCaster()->GetFirstCollisionPosition(30.0f, (float)rand_norm() * static_cast<float>(2 * M_PI));
|
||||
Position dest = GetCaster()->GetFirstCollisionPosition(30.0f, rand_norm() * static_cast<float>(2 * M_PI));
|
||||
GetCaster()->CastSpell(dest, SPELL_FLING_TORCH_TRIGGERED, true);
|
||||
GetCaster()->CastSpell(dest, SPELL_FLING_TORCH_SHADOW);
|
||||
}
|
||||
@@ -391,7 +391,7 @@ class spell_midsummer_fling_torch_catch : public SpellScript
|
||||
}
|
||||
else
|
||||
{
|
||||
Position dest = player->GetFirstCollisionPosition(15.0f, (float)rand_norm() * static_cast<float>(2 * M_PI));
|
||||
Position dest = player->GetFirstCollisionPosition(15.0f, rand_norm() * static_cast<float>(2 * M_PI));
|
||||
player->CastSpell(player, SPELL_TORCHES_CAUGHT);
|
||||
player->CastSpell(dest, SPELL_FLING_TORCH_TRIGGERED, true);
|
||||
player->CastSpell(dest, SPELL_FLING_TORCH_SHADOW);
|
||||
|
||||
Reference in New Issue
Block a user