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:
@@ -72,15 +72,15 @@ uint32 rand32()
|
||||
return GetRng()->RandomUInt32();
|
||||
}
|
||||
|
||||
double rand_norm()
|
||||
float rand_norm()
|
||||
{
|
||||
std::uniform_real_distribution<double> urd;
|
||||
std::uniform_real_distribution<float> urd;
|
||||
return urd(engine);
|
||||
}
|
||||
|
||||
double rand_chance()
|
||||
float rand_chance()
|
||||
{
|
||||
std::uniform_real_distribution<double> urd(0.0, 100.0);
|
||||
std::uniform_real_distribution<float> urd(0.0f, 100.0f);
|
||||
return urd(engine);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user