diff options
author | rubidium <rubidium@openttd.org> | 2008-07-17 16:38:26 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-07-17 16:38:26 +0000 |
commit | 83824f4c86b01c93465c0ab71dc84e03f9883e5f (patch) | |
tree | 07271e3a1b18b6d9dcf8379507ad9e2181f12091 | |
parent | 2810d26fded18a0cfbbc453ed2e5b178b93bb97a (diff) | |
download | openttd-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.
-rw-r--r-- | src/players.cpp | 21 |
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 |