summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-29 00:27:25 +0000
committerrubidium <rubidium@openttd.org>2008-01-29 00:27:25 +0000
commit1b7051768c65fe2886f1a562f5741a1e2d9acd11 (patch)
treea27a03588a37fa3492201013f224c9fdf751ecc3 /src/network
parent3f104194d6a99cd8d261b12d015cb2991f7e94ce (diff)
downloadopenttd-1b7051768c65fe2886f1a562f5741a1e2d9acd11.tar.xz
(svn r12004) -Codechange: refactor the random functions to reduce code duplication.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 1cd128181..b8a53feb5 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -1235,9 +1235,9 @@ static bool NetworkDoClientLoop()
if (_sync_frame != 0) {
if (_sync_frame == _frame_counter) {
#ifdef NETWORK_SEND_DOUBLE_SEED
- if (_sync_seed_1 != _random_seeds[0][0] || _sync_seed_2 != _random_seeds[0][1]) {
+ if (_sync_seed_1 != _random.state[0] || _sync_seed_2 != _random.state[1]) {
#else
- if (_sync_seed_1 != _random_seeds[0][0]) {
+ if (_sync_seed_1 != _random.state[0]) {
#endif
NetworkError(STR_NETWORK_ERR_DESYNC);
DebugDumpCommands("ddc:serr:%d;%d\n", _date, _date_fract);
@@ -1332,9 +1332,9 @@ void NetworkGameLoop()
// Then we make the frame
StateGameLoop();
- _sync_seed_1 = _random_seeds[0][0];
+ _sync_seed_1 = _random.state[0];
#ifdef NETWORK_SEND_DOUBLE_SEED
- _sync_seed_2 = _random_seeds[0][1];
+ _sync_seed_2 = _random.state[1];
#endif
NetworkServer_Tick(send_frame);