Remove: Hidden setting for adjacent stations (#12862)

This commit is contained in:
Tyler Trahan 2024-11-06 14:11:07 -05:00 committed by GitHub
parent 5d7a7b2955
commit c3bb512bd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 29 deletions

View File

@ -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"),

View File

@ -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

View File

@ -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) {

View File

@ -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<T>(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<T>(ta, false) == nullptr;
}
/**

View File

@ -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