diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index ff6a70627b..25d920e4ec 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -147,7 +147,7 @@ static const WindowDesc _air_toolbar_desc = { void ShowBuildAirToolbar() { - if (!IsValidCompanyID(_current_company)) return; + if (!IsValidCompanyID(_local_company)) return; DeleteWindowByClass(WC_BUILD_TOOLBAR); AllocateWindowDescFront(&_air_toolbar_desc, TRANSPORT_AIR); diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index bfb9a2b6f5..ac0324682f 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -166,7 +166,7 @@ struct CheatWindow : Window { case STR_CHEAT_CHANGE_COMPANY: SetDParam(0, val + 1); GetString(buf, STR_CHEAT_CHANGE_COMPANY, lastof(buf)); - DrawCompanyIcon(_current_company, 60 + GetStringBoundingBox(buf).width, y + 2); + DrawCompanyIcon(_local_company, 60 + GetStringBoundingBox(buf).width, y + 2); break; /* Set correct string for switch climate cheat */ diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 433d4c34a5..caecae95a4 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -282,7 +282,7 @@ static const WindowDesc _build_docks_toolbar_desc = { void ShowBuildDocksToolbar() { - if (!IsValidCompanyID(_current_company)) return; + if (!IsValidCompanyID(_local_company)) return; DeleteWindowByClass(WC_BUILD_TOOLBAR); AllocateWindowDescFront(&_build_docks_toolbar_desc, TRANSPORT_WATER); diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index d630026749..a2943a3093 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -417,7 +417,7 @@ public: void ShowBuildIndustryWindow() { - if (_game_mode != GM_EDITOR && !IsValidCompanyID(_current_company)) return; + if (_game_mode != GM_EDITOR && !IsValidCompanyID(_local_company)) return; if (BringWindowToFrontById(WC_BUILD_INDUSTRY, 0)) return; new BuildIndustryWindow(); } diff --git a/src/main_gui.cpp b/src/main_gui.cpp index e4e6913f2a..e333bf7f83 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -61,7 +61,7 @@ void HandleOnEditText(const char *str) switch (_rename_what) { #ifdef ENABLE_NETWORK case 3: { // Give money, you can only give money in excess of loan - const Company *c = GetCompany(_current_company); + const Company *c = GetCompany(_local_company); Money money = min(c->money - c->current_loan, (Money)(atoi(str) / _currency->rate)); uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0 diff --git a/src/order_gui.cpp b/src/order_gui.cpp index b20d1c5565..a7a8dc5ce7 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -350,7 +350,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) StationID st_index = GetStationIndex(tile); const Station *st = GetStation(st_index); - if (st->owner == _current_company || st->owner == OWNER_NONE) { + if (st->owner == _local_company || st->owner == OWNER_NONE) { byte facil; (facil = FACIL_DOCK, v->type == VEH_SHIP) || (facil = FACIL_TRAIN, v->type == VEH_TRAIN) || diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 86cc5f2986..309af58fcf 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -833,7 +833,7 @@ void ShowBuildRailToolbar(RailType railtype, int button) { BuildRailToolbarWindow *w; - if (!IsValidCompanyID(_current_company)) return; + if (!IsValidCompanyID(_local_company)) return; if (!ValParamRailtype(railtype)) return; // don't recreate the window if we're clicking on a button and the window exists. diff --git a/src/road_gui.cpp b/src/road_gui.cpp index ad9357d992..b36c4a9b7b 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -678,7 +678,7 @@ static const WindowDesc _build_tramway_desc = { void ShowBuildRoadToolbar(RoadType roadtype) { - if (!IsValidCompanyID(_current_company)) return; + if (!IsValidCompanyID(_local_company)) return; _cur_roadtype = roadtype; DeleteWindowByClass(WC_BUILD_TOOLBAR); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 62d3d642d5..94b7afc01e 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -952,16 +952,16 @@ struct StationViewWindow : public Window { case SVW_PLANES: { // Show a list of scheduled aircraft to this station const Station *st = GetStation(this->window_number); - /* Since oilrigs have no owners, show the scheduled aircraft of current company */ - Owner owner = (st->owner == OWNER_NONE) ? _current_company : st->owner; + /* Since oilrigs have no owners, show the scheduled aircraft of local company */ + Owner owner = (st->owner == OWNER_NONE) ? _local_company : st->owner; ShowVehicleListWindow(owner, VEH_AIRCRAFT, (StationID)this->window_number); break; } case SVW_SHIPS: { // Show a list of scheduled ships to this station const Station *st = GetStation(this->window_number); - /* Since oilrigs/bouys have no owners, show the scheduled ships of current company */ - Owner owner = (st->owner == OWNER_NONE) ? _current_company : st->owner; + /* Since oilrigs/bouys have no owners, show the scheduled ships of local company */ + Owner owner = (st->owner == OWNER_NONE) ? _local_company : st->owner; ShowVehicleListWindow(owner, VEH_SHIP, (StationID)this->window_number); break; } diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index f60d92cf76..82d2f5c424 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -334,7 +334,7 @@ static const WindowDesc _terraform_desc = { void ShowTerraformToolbar(Window *link) { - if (!IsValidCompanyID(_current_company)) return; + if (!IsValidCompanyID(_local_company)) return; Window *w = AllocateWindowDescFront(&_terraform_desc, 0); if (link == NULL) return; diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 29d5c62e62..ab70c9f6d3 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -529,7 +529,7 @@ static void MenuClickLeague(int index) static void ToolbarIndustryClick(Window *w) { /* Disable build-industry menu if we are a spectator */ - PopupMainToolbMenu(w, TBN_INDUSTRIES, STR_INDUSTRY_DIR, (_current_company == COMPANY_SPECTATOR) ? 1 : 2); + PopupMainToolbMenu(w, TBN_INDUSTRIES, STR_INDUSTRY_DIR, (_local_company == COMPANY_SPECTATOR) ? 1 : 2); } static void MenuClickIndustry(int index) @@ -1035,7 +1035,7 @@ struct MainToolbarWindow : Window { /* If spectator, disable all construction buttons * ie : Build road, rail, ships, airports and landscaping * Since enabled state is the default, just disable when needed */ - this->SetWidgetsDisabledState(_current_company == COMPANY_SPECTATOR, TBN_RAILS, TBN_ROADS, TBN_WATER, TBN_AIR, TBN_LANDSCAPE, WIDGET_LIST_END); + this->SetWidgetsDisabledState(_local_company == COMPANY_SPECTATOR, TBN_RAILS, TBN_ROADS, TBN_WATER, TBN_AIR, TBN_LANDSCAPE, WIDGET_LIST_END); /* disable company list drop downs, if there are no companies */ this->SetWidgetsDisabledState(ActiveCompanyCount() == TBN_PAUSE, TBN_STATIONS, TBN_FINANCES, TBN_TRAINS, TBN_ROADVEHS, TBN_SHIPS, TBN_AIRCRAFTS, WIDGET_LIST_END); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 20f68492f7..d887dcc7b6 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -725,6 +725,6 @@ static const WindowDesc _scen_edit_town_gen_desc = { void ShowBuildTownWindow() { - if (_game_mode != GM_EDITOR && !IsValidCompanyID(_current_company)) return; + if (_game_mode != GM_EDITOR && !IsValidCompanyID(_local_company)) return; AllocateWindowDescFront(&_scen_edit_town_gen_desc, 0); } diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 990f784da6..045de6c369 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -180,6 +180,6 @@ static const WindowDesc _build_trees_desc = { void ShowBuildTreesToolbar() { - if (_game_mode != GM_EDITOR && !IsValidCompanyID(_current_company)) return; + if (_game_mode != GM_EDITOR && !IsValidCompanyID(_local_company)) return; AllocateWindowDescFront(&_build_trees_desc, 0); } diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 2e5f87eea3..c53c130498 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1786,7 +1786,7 @@ bool CanBuildVehicleInfrastructure(VehicleType type) { assert(IsCompanyBuildableVehicleType(type)); - if (!IsValidCompanyID(_current_company)) return false; + if (!IsValidCompanyID(_local_company)) return false; if (_settings_client.gui.always_build_infrastructure) return true; UnitID max;