From 67723e42aaea5cd208aec49a2aec7915310a8692 Mon Sep 17 00:00:00 2001 From: yexo Date: Wed, 13 May 2009 12:07:36 +0000 Subject: (svn r16292) -Fix (r16287): autorenew settings were set to 0 when creating a new company in multiplayer --- src/company_cmd.cpp | 11 ++++------- 1 file 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(); } -- cgit v1.2.3-70-g09d2