From d14ac4478d35f7ae9b7ced6e78673a27a85fc878 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 24 Aug 2006 10:19:59 +0000 Subject: (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. --- os2.c | 3 +-- unix.c | 2 +- win32.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/os2.c b/os2.c index 91531eb58..de8cc661e 100644 --- a/os2.c +++ b/os2.c @@ -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); } diff --git a/unix.c b/unix.c index 9127f800d..97d287bea 100644 --- a/unix.c +++ b/unix.c @@ -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); diff --git a/win32.c b/win32.c index 48c50027c..6c692dced 100644 --- a/win32.c +++ b/win32.c @@ -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)); -- cgit v1.2.3-70-g09d2