summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-01-13 18:41:56 +0000
committerfrosch <frosch@openttd.org>2009-01-13 18:41:56 +0000
commit9ca1e15f51bcc5c9dac031936c8f22da60992c3f (patch)
tree69f162b6f245e77934eb0f2a424ee2c96151bfd5
parent2e30efb530e78cf81ec15aa9f36f1a495451bdb8 (diff)
downloadopenttd-9ca1e15f51bcc5c9dac031936c8f22da60992c3f.tar.xz
(svn r15069) -Change (r14919): Make distant-join less intelligent but more transparent to the user by always showing the selection window, even if there is only one option to choose from. (PhilSophus)
-rw-r--r--src/station_gui.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index cdfc2b955..47ec4cce1 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -1226,16 +1226,11 @@ static bool StationJoinerNeeded(CommandContainer cmd, int w, int h)
/* Now check if we could build there */
if (CmdFailed(DoCommand(&cmd, CommandFlagsToDCFlags(GetCommandFlags(cmd.cmd))))) return false;
- /* First test for adjacent station */
- FindStationsNearby(cmd.tile, w, h, false);
- int neighbour_station_count = _stations_nearby_list.Length();
- /* Now test for stations fully within station spread */
- const Station *st = FindStationsNearby(cmd.tile, w, h, true);
- if (_settings_game.station.adjacent_stations) {
- return (neighbour_station_count == 0 || _stations_nearby_list.Length() > 1) && st == NULL;
- } else {
- return neighbour_station_count == 0 && _stations_nearby_list.Length() > 0 && st == NULL;
- }
+ /* 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 immediatelly. */
+ const Station *st = FindStationsNearby(cmd.tile, w, h, false);
+ return st == NULL && (_settings_game.station.adjacent_stations || _stations_nearby_list.Length() == 0);
}
/**