diff options
author | yexo <yexo@openttd.org> | 2009-05-13 12:07:36 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-05-13 12:07:36 +0000 |
commit | 67723e42aaea5cd208aec49a2aec7915310a8692 (patch) | |
tree | 5f2008a333a38673615573d1d1d4931775bd73c7 /src | |
parent | aa0459309cef7773c5ad493abfcf4a60414275a6 (diff) | |
download | openttd-67723e42aaea5cd208aec49a2aec7915310a8692.tar.xz |
(svn r16292) -Fix (r16287): autorenew settings were set to 0 when creating a new company in multiplayer
Diffstat (limited to 'src')
-rw-r--r-- | src/company_cmd.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index bd62c2e5e..e5f31029f 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -749,6 +749,9 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /* This is the client (or non-dedicated server) who wants a new company */ if (cid == _network_own_client_id) { + /* Create p1 and p2 here because SetLocalCompany resets the gui.autorenew* settings. */ + uint32 p1 = (_settings_client.gui.autorenew << 15 ) | (_settings_client.gui.autorenew_months << 16) | 4; + uint32 p2 = _settings_client.gui.autorenew_money; assert(_local_company == COMPANY_SPECTATOR); SetLocalCompany(c->index); if (!StrEmpty(_settings_client.network.default_company_pass)) { @@ -760,13 +763,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /* Now that we have a new company, 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, - NULL - ); + NetworkSend_Command(0, p1, p2, CMD_SET_AUTOREPLACE, NULL, NULL); MarkWholeScreenDirty(); } |