(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.
authorrubidium
Thu, 24 Aug 2006 10:19:59 +0000
changeset 4369 02b9ab2cf501
parent 4368 a0c7a1197785
child 4370 c7bd128b1670
(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
unix.c
win32.c
--- a/os2.c	Thu Aug 24 10:11:32 2006 +0000
+++ b/os2.c	Thu Aug 24 10:19:59 2006 +0000
@@ -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	Thu Aug 24 10:11:32 2006 +0000
+++ b/unix.c	Thu Aug 24 10:19:59 2006 +0000
@@ -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	Thu Aug 24 10:11:32 2006 +0000
+++ b/win32.c	Thu Aug 24 10:19:59 2006 +0000
@@ -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));