summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-17 16:38:26 +0000
committerrubidium <rubidium@openttd.org>2008-07-17 16:38:26 +0000
commit83824f4c86b01c93465c0ab71dc84e03f9883e5f (patch)
tree07271e3a1b18b6d9dcf8379507ad9e2181f12091 /src
parent2810d26fded18a0cfbbc453ed2e5b178b93bb97a (diff)
downloadopenttd-83824f4c86b01c93465c0ab71dc84e03f9883e5f.tar.xz
(svn r13718) -Fix: possible desync on the autorenew settings 20+ game years (i.e. 4.5+ hours) after a company was started.
Diffstat (limited to 'src')
-rw-r--r--src/players.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/players.cpp b/src/players.cpp
index d9c1178a7..ddb17ab2e 100644
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -866,18 +866,21 @@ CommandCost CmdPlayerCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
char *password = _settings_client.network.default_company_pass;
NetworkChangeCompanyPassword(1, &password);
}
+
+ _current_player = _local_player;
+
+ /* Now that we have a new player, broadcast our autorenew settings to
+ * all clients so everything is in sync */
+ NetworkSend_Command(0,
+ (_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4,
+ _settings_client.gui.autorenew_money,
+ CMD_SET_AUTOREPLACE,
+ NULL
+ );
+
MarkWholeScreenDirty();
}
- /* Now that we have a new player, broadcast its autorenew settings to
- * all clients so everything is in sync */
- DoCommand(0,
- (_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4,
- _settings_client.gui.autorenew_money,
- DC_EXEC,
- CMD_SET_AUTOREPLACE
- );
-
if (_network_server) {
/* XXX - UGLY! p2 (pid) is mis-used to fetch the client-id, done at
* server-side in network_server.c:838, function