summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-10-22 22:51:15 +0000
committerfrosch <frosch@openttd.org>2010-10-22 22:51:15 +0000
commitcb43ece0914eeaf526828783a24a0c29d2ed96ce (patch)
treeae63ac7bbce719bb3220c640ad2e6ccf43af10bb
parentaf6c12d5862e8d918f496aa9f1a6093f7b0bc86d (diff)
downloadopenttd-cb43ece0914eeaf526828783a24a0c29d2ed96ce.tar.xz
(svn r21014) -Fix [FS#4179](r20098): Reversing of trains in stations while last wagon was in a depot or on a bridge-/tunnelhead caused trouble.
-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 2f0733e91..a34cf77c9 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3712,7 +3712,10 @@ static bool TrainLocoHandler(Train *v, bool mode)
/* Try to reserve a path when leaving the station as we
* might not be marked as wanting a reservation, e.g.
* when an overlength train gets turned around in a station. */
- if (UpdateSignalsOnSegment(v->tile, TrackdirToExitdir(v->GetVehicleTrackdir()), v->owner) == SIGSEG_PBS || _settings_game.pf.reserve_paths) {
+ DiagDirection dir = TrainExitDir(v->direction, v->track);
+ if (IsRailDepotTile(v->tile) || IsTileType(v->tile, MP_TUNNELBRIDGE)) dir = INVALID_DIAGDIR;
+
+ if (UpdateSignalsOnSegment(v->tile, dir, v->owner) == SIGSEG_PBS || _settings_game.pf.reserve_paths) {
TryPathReserve(v, true, true);
}
ClrBit(v->flags, VRF_LEAVING_STATION);