mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-03 16:53:54 +03:00
Prevent getting locked down with unitialized random seed
This commit is contained in:
parent
2d803af01f
commit
62029c436c
@ -19,6 +19,9 @@ void Rand_Init(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
f32 Rand_ZeroOne(void) {
|
f32 Rand_ZeroOne(void) {
|
||||||
|
if (sRandSeed1 == sRandSeed2 == sRandSeed3 == 0){
|
||||||
|
Rand_Init();
|
||||||
|
}
|
||||||
sRandSeed1 = (sRandSeed1 * 171) % 30269;
|
sRandSeed1 = (sRandSeed1 * 171) % 30269;
|
||||||
sRandSeed2 = (sRandSeed2 * 172) % 30307;
|
sRandSeed2 = (sRandSeed2 * 172) % 30307;
|
||||||
sRandSeed3 = (sRandSeed3 * 170) % 30323;
|
sRandSeed3 = (sRandSeed3 * 170) % 30323;
|
||||||
|
Loading…
Reference in New Issue
Block a user