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 authored and Ovahlord committed 2023-10-31 22:00:52 +01:00
1 parent 56dc3bddd5
commit 7d57ef7299
13 files changed
+26 -26

No files matched your search

+1 -1
View File
@@ -173,7 +173,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
full_chance += item_iter->chance;
float rate = full_chance / 100.0f;
float roll = (float)rand_chance() * rate; // roll now in range 0..full_chance
float roll = rand_chance() * rate; // roll now in range 0..full_chance
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
{