summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 3e81cd842..80ead8107 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2936,7 +2936,10 @@ static Track ChooseTrainTrack(Vehicle* v, TileIndex tile, DiagDirection enterdir
* for a path and no look-ahead is necessary. This also avoids a
* problem with depot orders not part of the order list when the
* order list itself is empty. */
- if (!v->current_order.IsType(OT_GOTO_DEPOT) && (v->tile == v->dest_tile || (v->current_order.IsType(OT_GOTO_STATION) && IsRailwayStationTile(v->tile) && v->current_order.GetDestination() == GetStationIndex(v->tile)))) {
+ if (!v->current_order.IsType(OT_GOTO_DEPOT) && (
+ v->current_order.IsType(OT_GOTO_STATION) ?
+ IsRailwayStationTile(v->tile) && v->current_order.GetDestination() == GetStationIndex(v->tile) :
+ v->tile == v->dest_tile)) {
orders.SwitchToNextOrder();
}