mirror of https://github.com/OpenRCT2/OpenRCT2.git
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.
This commit is contained in:
parent
5c5e9095db
commit
60b8ef6c0b
|
@ -14,7 +14,9 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#include <time.h>
|
#include "../common.h"
|
||||||
|
#include <SDL.h>
|
||||||
|
|
||||||
#include "../object.h"
|
#include "../object.h"
|
||||||
#include "../util/util.h"
|
#include "../util/util.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
@ -122,7 +124,7 @@ void mapgen_generate(mapgen_settings *settings)
|
||||||
int x, y, mapSize, floorTexture, wallTexture, waterLevel;
|
int x, y, mapSize, floorTexture, wallTexture, waterLevel;
|
||||||
rct_map_element *mapElement;
|
rct_map_element *mapElement;
|
||||||
|
|
||||||
util_srand((unsigned int)time(NULL));
|
util_srand((int)SDL_GetTicks());
|
||||||
|
|
||||||
mapSize = settings->mapSize;
|
mapSize = settings->mapSize;
|
||||||
floorTexture = settings->floor;
|
floorTexture = settings->floor;
|
||||||
|
|
Loading…
Reference in New Issue