(svn r2588) Codechange: Remove PLAYER_SEED_RANDOM
authorludde
Sat, 16 Jul 2005 12:30:03 +0000
changeset 2078 94c05035e2ce
parent 2077 8d9a286eba0d
child 2079 5afd2e7fc3bd
(svn r2588) Codechange: Remove PLAYER_SEED_RANDOM
functions.h
misc.c
network.c
network_client.c
network_server.c
openttd.c
variables.h
--- a/functions.h	Sat Jul 16 09:55:31 2005 +0000
+++ b/functions.h	Sat Jul 16 12:30:03 2005 +0000
@@ -123,12 +123,6 @@
 static inline TileIndex RandomTile(void) { return TILE_MASK(Random()); }
 
 
-#ifdef PLAYER_SEED_RANDOM
-void InitPlayerRandoms(void);
-#endif
-
-
-
 uint32 InteractiveRandom(void); /* Used for random sequences that are not the same on the other end of the multiplayer link */
 uint InteractiveRandomRange(uint max);
 
--- a/misc.c	Sat Jul 16 09:55:31 2005 +0000
+++ b/misc.c	Sat Jul 16 12:30:03 2005 +0000
@@ -24,11 +24,6 @@
 	return (x >> n) + (x << ((sizeof(x)*8)-n));
 }
 
-/* XXX - Player-seeds don't seem to be used anymore.. which is a good thing
-     so I just disabled them for now. If there are no problems, we can remove
-     it completely! -- TrueLight */
-#undef PLAYER_SEED_RANDOM
-
 #ifndef MERSENNE_TWISTER
 
 #ifdef RANDOM_DEBUG
@@ -47,25 +42,10 @@
 		printf("Random [%d/%d] %s:%d\n",_frame_counter, _current_player, file, line);
 #endif
 
-#ifdef PLAYER_SEED_RANDOM
-	if (_current_player>=MAX_PLAYERS || !_networking) {
-		s = _random_seeds[0][0];
-		t = _random_seeds[0][1];
-		_random_seeds[0][0] = s + ROR(t ^ 0x1234567F, 7) + 1;
-		return _random_seeds[0][1] = ROR(s, 3) - 1;
-	} else {
-		uint32 s = _player_seeds[_current_player][0];
-		uint32 t = _player_seeds[_current_player][1];
-		_player_seeds[_current_player][0] = s + ROR(t ^ 0x1234567F, 7) + 1;
-		DEBUG(net, 1)("[NET-Seeds] Player seed called!");
-		return _player_seeds[_current_player][1] = ROR(s, 3) - 1;
-	}
-#else
 	s = _random_seeds[0][0];
 	t = _random_seeds[0][1];
 	_random_seeds[0][0] = s + ROR(t ^ 0x1234567F, 7) + 1;
 	return _random_seeds[0][1] = ROR(s, 3) - 1;
-#endif
 }
 #endif // MERSENNE_TWISTER
 
@@ -95,18 +75,6 @@
 	return (uint16)InteractiveRandom() * max >> 16;
 }
 
-
-#ifdef PLAYER_SEED_RANDOM
-void InitPlayerRandoms(void)
-{
-	int i;
-	for (i=0; i<MAX_PLAYERS; i++) {
-		_player_seeds[i][0]=InteractiveRandom();
-		_player_seeds[i][1]=InteractiveRandom();
-	}
-}
-#endif
-
 void SetDate(uint date)
 {
 	YearMonthDay ymd;
--- a/network.c	Sat Jul 16 09:55:31 2005 +0000
+++ b/network.c	Sat Jul 16 12:30:03 2005 +0000
@@ -773,10 +773,6 @@
 
 	_network_reconnect = 0;
 
-#ifdef PLAYER_SEED_RANDOM
-	InitPlayerRandoms();
-#endif
-
 	NetworkUDPInitialize();
 }
 
--- a/network_client.c	Sat Jul 16 09:55:31 2005 +0000
+++ b/network_client.c	Sat Jul 16 12:30:03 2005 +0000
@@ -487,15 +487,6 @@
 
 	// Check if this was the last packet
 	if (maptype == MAP_PACKET_END) {
-		// We also get, very nice, the player_seeds in this packet
-#ifdef PLAYER_SEED_RANDOM
-		int i;
-		for (i = 0; i < MAX_PLAYERS; i++) {
-			_player_seeds[i][0] = NetworkRecv_uint32(MY_CLIENT, p);
-			_player_seeds[i][1] = NetworkRecv_uint32(MY_CLIENT, p);
-		}
-#endif
-
 		fclose(file_pointer);
 
 		_network_join_status = NETWORK_JOIN_STATUS_PROCESSING;
--- a/network_server.c	Sat Jul 16 09:55:31 2005 +0000
+++ b/network_server.c	Sat Jul 16 12:30:03 2005 +0000
@@ -323,9 +323,6 @@
 			NetworkSend_Packet(p, cs);
 			if (feof(file_pointer)) {
 				// Done reading!
-#ifdef PLAYER_SEED_RANDOM
-				int i;
-#endif
 				Packet *p;
 
 				// XXX - Delete this when patch-settings are saved in-game
@@ -333,13 +330,6 @@
 
 				p = NetworkSend_Init(PACKET_SERVER_MAP);
 				NetworkSend_uint8(p, MAP_PACKET_END);
-#ifdef PLAYER_SEED_RANDOM
-				// Send the player_seeds in this packet
-				for (i = 0; i < MAX_PLAYERS; i++) {
-					NetworkSend_uint32(p, _player_seeds[i][0]);
-					NetworkSend_uint32(p, _player_seeds[i][1]);
-				}
-#endif
 				NetworkSend_Packet(p, cs);
 
 				// Set the status to DONE_MAP, no we will wait for the client
--- a/openttd.c	Sat Jul 16 09:55:31 2005 +0000
+++ b/openttd.c	Sat Jul 16 12:30:03 2005 +0000
@@ -676,10 +676,6 @@
 	InitializeGUI();
 	IConsoleCmdExec("exec scripts/autoexec.scr 0");
 
-#ifdef PLAYER_SEED_RANDOM
-	InitPlayerRandoms();
-#endif
-
 	GenerateWorld(1, 64, 64); // Make the viewport initialization happy
 
 #ifdef ENABLE_NETWORK
--- a/variables.h	Sat Jul 16 09:55:31 2005 +0000
+++ b/variables.h	Sat Jul 16 12:30:03 2005 +0000
@@ -83,10 +83,6 @@
 
 VARDEF uint32 _random_seeds[2][2];
 
-#ifdef PLAYER_SEED_RANDOM
-VARDEF uint32 _player_seeds[MAX_PLAYERS][2];
-#endif
-
 // Iterator through all towns in OnTick_Town
 VARDEF uint32 _cur_town_ctr;
 // Frequency iterator at the same place