From 313108092b9d7849c13797514bac8dee2d167074 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Fri, 10 Jan 2025 02:52:04 +0300 Subject: [PATCH] don't use clamped float random_seed internally --- src/twn_loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/twn_loop.c b/src/twn_loop.c index 28f30d7..56c2dcb 100644 --- a/src/twn_loop.c +++ b/src/twn_loop.c @@ -585,8 +585,8 @@ static bool initialize(void) { /* SDL_GetPerformanceCounter returns some platform-dependent number. */ /* it should vary between game instances. i checked! random enough for me. */ ctx.game.random_seed = (float)(SDL_GetPerformanceCounter() % 16777216); - srand((unsigned int)ctx.game.random_seed); - stbds_rand_seed((size_t)ctx.game.random_seed); + srand((unsigned int)(SDL_GetPerformanceCounter())); + stbds_rand_seed((size_t)(SDL_GetPerformanceCounter())); /* main loop machinery */ toml_datum_t datum_ticks_per_second = toml_int_in(engine, "ticks_per_second");