From 60b8ef6c0bb335f94963af4ee1f57236efec1295 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 12:11:48 +0100 Subject: [PATCH] Use more precise seed for random map generation Clicking generate map quickly would generate roughly the same map twice in a row because the seed was using second precision timing rather than millisecond. --- src/world/mapgen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/world/mapgen.c b/src/world/mapgen.c index f00075d8fd..0c84fc72c3 100644 --- a/src/world/mapgen.c +++ b/src/world/mapgen.c @@ -14,7 +14,9 @@ *****************************************************************************/ #pragma endregion -#include +#include "../common.h" +#include + #include "../object.h" #include "../util/util.h" #include "map.h" @@ -122,7 +124,7 @@ void mapgen_generate(mapgen_settings *settings) int x, y, mapSize, floorTexture, wallTexture, waterLevel; rct_map_element *mapElement; - util_srand((unsigned int)time(NULL)); + util_srand((int)SDL_GetTicks()); mapSize = settings->mapSize; floorTexture = settings->floor;