diff options
author | aap <aap@papnet.eu> | 2019-05-29 23:17:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-29 23:17:41 +0200 |
commit | b705be0e873a3b93c561a7945748328604e48f21 (patch) | |
tree | 8f8b32c251a57707b676a037d6846e7d0162dd18 /src/General.h | |
parent | implemented some of CCam and dependencies (diff) | |
parent | fix2 (diff) | |
download | re3-b705be0e873a3b93c561a7945748328604e48f21.tar re3-b705be0e873a3b93c561a7945748328604e48f21.tar.gz re3-b705be0e873a3b93c561a7945748328604e48f21.tar.bz2 re3-b705be0e873a3b93c561a7945748328604e48f21.tar.lz re3-b705be0e873a3b93c561a7945748328604e48f21.tar.xz re3-b705be0e873a3b93c561a7945748328604e48f21.tar.zst re3-b705be0e873a3b93c561a7945748328604e48f21.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 8e1a2521..d67b1ff0 100644 --- a/src/General.h +++ b/src/General.h @@ -1,3 +1,6 @@ + + + class CGeneral { public: @@ -43,5 +46,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(MY_RAND_MAX + 1)); } + + static Int32 GetRandomNumberInRange(Int32 low, Int32 high) + { return low + (high - low)*(GetRandomNumber()/float(MY_RAND_MAX + 1)); } }; |