From c3bb512bd95ecb9f0a69cc67682e302df2f2ced3 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Wed, 6 Nov 2024 14:11:07 -0500 Subject: [PATCH] Remove: Hidden setting for adjacent stations (#12862) --- src/saveload/compat/settings_sl_compat.h | 2 +- src/settings_type.h | 1 - src/station_cmd.cpp | 30 +++++++++++------------- src/station_gui.cpp | 6 +---- src/table/settings/game_settings.ini | 6 ----- 5 files changed, 16 insertions(+), 29 deletions(-) diff --git a/src/saveload/compat/settings_sl_compat.h b/src/saveload/compat/settings_sl_compat.h index 37005b98e2..422e5a2785 100644 --- a/src/saveload/compat/settings_sl_compat.h +++ b/src/saveload/compat/settings_sl_compat.h @@ -129,7 +129,7 @@ const SaveLoadCompat _settings_sl_compat[] = { SLC_VAR("order.gradual_loading"), SLC_VAR("construction.road_stop_on_town_road"), SLC_VAR("construction.road_stop_on_competitor_road"), - SLC_VAR("station.adjacent_stations"), + SLC_NULL(1, SLV_62, SLV_TABLE_CHUNKS), SLC_VAR("economy.station_noise_level"), SLC_VAR("station.distant_join_stations"), SLC_VAR("economy.inflation"), diff --git a/src/settings_type.h b/src/settings_type.h index ae6f22c42e..157bdf6058 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -564,7 +564,6 @@ struct LinkGraphSettings { struct StationSettings { bool modified_catchment; ///< different-size catchment areas bool serve_neutral_industries; ///< company stations can serve industries with attached neutral stations - bool adjacent_stations; ///< allow stations to be built directly adjacent to other stations bool distant_join_stations; ///< allow to join non-adjacent stations bool never_expire_airports; ///< never expire airports uint8_t station_spread; ///< amount a station may spread diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 4353e8010a..07790c478a 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1167,24 +1167,22 @@ CommandCost FindJoiningBaseStation(StationID existing_station, StationID station assert(*st == nullptr); bool check_surrounding = true; - if (_settings_game.station.adjacent_stations) { - if (existing_station != INVALID_STATION) { - if (adjacent && existing_station != station_to_join) { - /* You can't build an adjacent station over the top of one that - * already exists. */ - return_cmd_error(error_message); - } else { - /* Extend the current station, and don't check whether it will - * be near any other stations. */ - T *candidate = T::GetIfValid(existing_station); - if (candidate != nullptr && filter(candidate)) *st = candidate; - check_surrounding = (*st == nullptr); - } + if (existing_station != INVALID_STATION) { + if (adjacent && existing_station != station_to_join) { + /* You can't build an adjacent station over the top of one that + * already exists. */ + return_cmd_error(error_message); } else { - /* There's no station here. Don't check the tiles surrounding this - * one if the company wanted to build an adjacent station. */ - if (adjacent) check_surrounding = false; + /* Extend the current station, and don't check whether it will + * be near any other stations. */ + T *candidate = T::GetIfValid(existing_station); + if (candidate != nullptr && filter(candidate)) *st = candidate; + check_surrounding = (*st == nullptr); } + } else { + /* There's no station here. Don't check the tiles surrounding this + * one if the company wanted to build an adjacent station. */ + if (adjacent) check_surrounding = false; } if (check_surrounding) { diff --git a/src/station_gui.cpp b/src/station_gui.cpp index dcbe56b84e..ad2fc18ad2 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2455,11 +2455,7 @@ static bool StationJoinerNeeded(TileArea ta, const StationPickerCmdProc &proc) /* Now check if we could build there */ if (!proc(true, INVALID_STATION)) return false; - /* Test for adjacent station or station below selection. - * If adjacent-stations is disabled and we are building next to a station, do not show the selection window. - * but join the other station immediately. */ - const BaseStation *st = FindStationsNearby(ta, false); - return st == nullptr && (_settings_game.station.adjacent_stations || std::any_of(std::begin(_stations_nearby_list), std::end(_stations_nearby_list), [](StationID s) { return s != NEW_STATION; })); + return FindStationsNearby(ta, false) == nullptr; } /** diff --git a/src/table/settings/game_settings.ini b/src/table/settings/game_settings.ini index 07adda5cc9..c29bf636ab 100644 --- a/src/table/settings/game_settings.ini +++ b/src/table/settings/game_settings.ini @@ -131,12 +131,6 @@ str = STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES strhelp = STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT post_cb = StationCatchmentChanged -[SDT_BOOL] -var = station.adjacent_stations -from = SLV_62 -def = true -cat = SC_EXPERT - [SDT_BOOL] var = station.distant_join_stations from = SLV_106