mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-04-28 12:27:59 +03:00
Rand fix for platforms other than Win64
This commit is contained in:
parent
a8743658e0
commit
67d8ec2aef
1 changed files with 2 additions and 6 deletions
|
@ -13,18 +13,14 @@ f32 Math_ModF(f32 value, f32 mod) {
|
|||
}
|
||||
|
||||
void Rand_Init(void) {
|
||||
#if defined(__SWITCH__) || defined(__linux__)
|
||||
sRandSeed1 = (s32) osGetTime() % 30000 + 1;
|
||||
sRandSeed2 = (s32) osGetTime() % 30000 + 1;
|
||||
sRandSeed3 = (s32) osGetTime() % 30000 + 1;
|
||||
#else
|
||||
sRandSeed1 = (s32) osGetTime() % 30000;
|
||||
sRandSeed2 = (s32) osGetTime() % 30000;
|
||||
sRandSeed3 = (s32) osGetTime() % 30000;
|
||||
#endif
|
||||
}
|
||||
|
||||
f32 Rand_ZeroOne(void) {
|
||||
// LTODO: On these platforms, something corrupts the seeds, causing one of them to be 0.
|
||||
// This is a workaround to circumvent this issue, that needs to be fixed.
|
||||
#if defined(__SWITCH__) || defined(__linux__)
|
||||
if ((sRandSeed1 == 0) || (sRandSeed2 == 0) || (sRandSeed2 == 0)) {
|
||||
Rand_Init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue