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
@@ -4914,7 +4914,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
//GO is always friendly to it's creator, get range for friends
float min_dis = m_spellInfo->GetMinRange(true);
float max_dis = m_spellInfo->GetMaxRange(true);
float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis;
float dis = rand_norm() * (max_dis - min_dis) + min_dis;
unitCaster->GetClosePoint(fx, fy, fz, DEFAULT_PLAYER_BOUNDING_RADIUS, dis);
fo = unitCaster->GetOrientation();