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:
@@ -174,16 +174,16 @@ bool Weather::ReGenerate()
|
||||
}
|
||||
else if (u < 90)
|
||||
{
|
||||
m_intensity = (float)rand_norm() * 0.3333f;
|
||||
m_intensity = rand_norm() * 0.3333f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Severe change, but how severe?
|
||||
rnd = urand(0, 99);
|
||||
if (rnd < 50)
|
||||
m_intensity = (float)rand_norm() * 0.3333f + 0.3334f;
|
||||
m_intensity = rand_norm() * 0.3333f + 0.3334f;
|
||||
else
|
||||
m_intensity = (float)rand_norm() * 0.3333f + 0.6667f;
|
||||
m_intensity = rand_norm() * 0.3333f + 0.6667f;
|
||||
}
|
||||
|
||||
// return true only in case weather changes
|
||||
|
||||
Reference in New Issue
Block a user