summaryrefslogtreecommitdiff
path: root/src/company_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-06-05 13:32:42 +0000
committerfrosch <frosch@openttd.org>2010-06-05 13:32:42 +0000
commit9e53f1e004bf8e65f268b8854a6eb08229e3f2ed (patch)
treefa373b8ec4b6089ac9c1e51f168d44434df8c238 /src/company_cmd.cpp
parente852bf154f2af40b3cee1f67bef41a78c2056de5 (diff)
downloadopenttd-9e53f1e004bf8e65f268b8854a6eb08229e3f2ed.tar.xz
(svn r19933) -Fix [FS#3804]: Keep _current_company and _local_company in sync during GUI operation.
Diffstat (limited to 'src/company_cmd.cpp')
-rw-r--r--src/company_cmd.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 93178dd80..fe3dc29a4 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -99,7 +99,9 @@ void SetLocalCompany(CompanyID new_company)
InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company);
#endif
- _local_company = new_company;
+ assert(_current_company == _local_company);
+
+ _current_company = _local_company = new_company;
/* Delete any construction windows... */
DeleteConstructionWindows();
@@ -736,8 +738,6 @@ void CompanyNewsInformation::FillData(const Company *c, const Company *other)
*/
CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- if (flags & DC_EXEC) _current_company = OWNER_NONE;
-
InvalidateWindowData(WC_COMPANY_LEAGUE, 0, 0);
switch (p1) {
@@ -783,8 +783,6 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
NetworkChangeCompanyPassword(_settings_client.network.default_company_pass);
}
- _current_company = _local_company;
-
/* Now that we have a new company, broadcast our company settings to
* all clients so everything is in sync */
SyncCompanySettings();