diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-05-29 20:02:58 +0200 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-05-29 20:02:58 +0200 |
commit | 197767d1c83f8d940698cd200785e91fbc2ccc98 (patch) | |
tree | c1ee0bb77ae0dbef844cf45eb9d2ffb00b08895f /src/General.h | |
parent | Particle, ParticleMgr done (diff) | |
download | re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.gz re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.bz2 re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.lz re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.xz re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.zst re3-197767d1c83f8d940698cd200785e91fbc2ccc98.zip |
Diffstat (limited to '')
-rw-r--r-- | src/General.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/General.h b/src/General.h index 7aacee39..38737bd5 100644 --- a/src/General.h +++ b/src/General.h @@ -1,3 +1,6 @@ + + + class CGeneral { public: @@ -11,5 +14,8 @@ public: { return myrand() & 0xFFFF; } // Probably don't want to ever reach high static float GetRandomNumberInRange(float low, float high) - { return low + (high - low)*(GetRandomNumber()/65536.0f); } + { return low + (high - low)*(GetRandomNumber()/float(RAND_MAX + 1)); } + + static Int32 GetRandomNumberInRange(Int32 low, Int32 high) + { return low + (high - low)*(GetRandomNumber()/float(RAND_MAX + 1)); } }; |