changeset 4369:7d3368bc1e46 draft

(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.
author rubidium <rubidium@openttd.org>
date Thu, 24 Aug 2006 10:19:59 +0000
parents f640363c4ed9
children 96a75b232d04
files os2.c unix.c win32.c
diffstat 3 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/os2.c
+++ b/os2.c
@@ -125,8 +125,7 @@
 	// 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);
 }
--- a/unix.c
+++ b/unix.c
@@ -151,7 +151,7 @@
 	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);
--- a/win32.c
+++ b/win32.c
@@ -859,8 +859,8 @@
 	_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));