diff options
author | rubidium <rubidium@openttd.org> | 2006-08-24 10:19:59 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-08-24 10:19:59 +0000 |
commit | d14ac4478d35f7ae9b7ced6e78673a27a85fc878 (patch) | |
tree | 495f01b0b0c73eb75ae04baf11bd52020619fb18 | |
parent | e9443f0d7ae7b06bb8daac7aec18c11a46f4a31d (diff) | |
download | openttd-d14ac4478d35f7ae9b7ced6e78673a27a85fc878.tar.xz |
(svn r6086) -Fix: InteractiveRandom was not seeded properly resulting in the dedicated server always generating the same map. Thanks to the #openttdcoop team for detecting.
-rw-r--r-- | os2.c | 3 | ||||
-rw-r--r-- | unix.c | 2 | ||||
-rw-r--r-- | win32.c | 4 |
3 files changed, 4 insertions, 5 deletions
@@ -125,8 +125,7 @@ int CDECL main(int argc, char* argv[]) // change the working directory to enable doubleclicking in UIs ChangeWorkingDirectory(argv[0]); - _random_seeds[0][1] = _random_seeds[0][0] = time(NULL); - + _random_seeds[1][1] = _random_seeds[1][0] = _random_seeds[0][1] = _random_seeds[0][0] = time(NULL); return ttd_main(argc, argv); } @@ -151,7 +151,7 @@ int CDECL main(int argc, char* argv[]) ChangeWorkingDirectory(argv[0]); #endif - _random_seeds[0][1] = _random_seeds[0][0] = time(NULL); + _random_seeds[1][1] = _random_seeds[1][0] = _random_seeds[0][1] = _random_seeds[0][0] = time(NULL); SeedMT(_random_seeds[0][1]); signal(SIGPIPE, SIG_IGN); @@ -859,8 +859,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, _set_error_mode(_OUT_TO_MSGBOX); // force assertion output to messagebox // setup random seed to something quite random - _random_seeds[0][0] = GetTickCount(); - _random_seeds[0][1] = _random_seeds[0][0] * 0x1234567; + _random_seeds[1][0] = _random_seeds[0][0] = GetTickCount(); + _random_seeds[1][1] = _random_seeds[0][1] = _random_seeds[0][0] * 0x1234567; SeedMT(_random_seeds[0][0]); argc = ParseCommandLine(GetCommandLine(), argv, lengthof(argv)); |