summaryrefslogtreecommitdiff
path: root/src/sys/sys_math.c
diff options
context:
space:
mode:
authorSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-03-08 00:13:26 -0300
committerSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-03-08 00:13:26 -0300
commit67d8ec2aefd2a0135d3730494b9b59ebb027209b (patch)
treeae29e1fef5167cc9dfccda9f5b4cf95b816e3d73 /src/sys/sys_math.c
parenta8743658e0ae82f21f817947c9a1b896269e8956 (diff)
Rand fix for platforms other than Win64
Diffstat (limited to 'src/sys/sys_math.c')
-rw-r--r--src/sys/sys_math.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/sys/sys_math.c b/src/sys/sys_math.c
index 826273d3..596ef95c 100644
--- a/src/sys/sys_math.c
+++ b/src/sys/sys_math.c
@@ -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();