1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-15 16:32:41 +01:00

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
5 changed files with 16 additions and 29 deletions

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