diff options
-rw-r--r-- | functions.h | 6 | ||||
-rw-r--r-- | misc.c | 32 | ||||
-rw-r--r-- | network.c | 4 | ||||
-rw-r--r-- | network_client.c | 9 | ||||
-rw-r--r-- | network_server.c | 10 | ||||
-rw-r--r-- | openttd.c | 4 | ||||
-rw-r--r-- | variables.h | 4 |
7 files changed, 0 insertions, 69 deletions
diff --git a/functions.h b/functions.h index 0b62da095..2387fa19d 100644 --- a/functions.h +++ b/functions.h @@ -123,12 +123,6 @@ static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); } 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); @@ -24,11 +24,6 @@ static inline uint32 ROR(uint32 x, int n) 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 @@ uint32 t; 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 @@ uint InteractiveRandomRange(uint max) 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; @@ -773,10 +773,6 @@ static void NetworkInitialize(void) _network_reconnect = 0; -#ifdef PLAYER_SEED_RANDOM - InitPlayerRandoms(); -#endif - NetworkUDPInitialize(); } diff --git a/network_client.c b/network_client.c index 5b6a8bf27..697df83c1 100644 --- a/network_client.c +++ b/network_client.c @@ -487,15 +487,6 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP) // 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; diff --git a/network_server.c b/network_server.c index 76223dfd2..e3c8a511c 100644 --- a/network_server.c +++ b/network_server.c @@ -323,9 +323,6 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP) 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 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP) 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 @@ -676,10 +676,6 @@ int ttd_main(int argc, char* argv[]) 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 diff --git a/variables.h b/variables.h index 011627fe2..94140d9be 100644 --- a/variables.h +++ b/variables.h @@ -83,10 +83,6 @@ VARDEF uint16 _station_tick_ctr; 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 |