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:
Shauren
2023-10-31 20:20:00 +01:00
parent a0fdac0ecc
commit 9894f6b802
22 changed files with 47 additions and 45 deletions

View File

@@ -304,7 +304,7 @@ void PoolGroup<T>::SpawnObject(SpawnedPoolData& spawns, uint32 limit, uint64 tri
// roll objects to be spawned
if (!ExplicitlyChanced.empty())
{
float roll = (float)rand_chance();
float roll = rand_chance();
for (PoolObject& obj : ExplicitlyChanced)
{