From f12b3a0c1816dc5a8b95132b95025740f6c2b438 Mon Sep 17 00:00:00 2001 From: ludde Date: Sat, 16 Jul 2005 12:30:03 +0000 Subject: (svn r2588) Codechange: Remove PLAYER_SEED_RANDOM --- functions.h | 6 ------ misc.c | 32 -------------------------------- network.c | 4 ---- network_client.c | 9 --------- network_server.c | 10 ---------- openttd.c | 4 ---- variables.h | 4 ---- 7 files changed, 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); diff --git a/misc.c b/misc.c index 0beffba71..193c7fa22 100644 --- a/misc.c +++ b/misc.c @@ -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