mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-09 00:45:52 +00:00
Revert Range(s32,s32) change (causes segfault do to improper results)
This commit is contained in:
parent
2e784a1941
commit
92e1865db4
@ -43,8 +43,11 @@ public:
|
||||
|
||||
inline s32 Range(s32 min, s32 max)
|
||||
{
|
||||
const s32 rand = Next();
|
||||
return min + (rand / ((min - max) + 1)) - rand;
|
||||
s32 diff = max - min;
|
||||
s32 rand = -1;
|
||||
while (rand < 0)
|
||||
rand = s32((Next() << 16) | Next());
|
||||
return rand % diff + min;
|
||||
}
|
||||
|
||||
static CRandom16* GetRandomNumber() {return g_randomNumber;}
|
||||
|
Loading…
x
Reference in New Issue
Block a user