summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-08-22 22:28:26 +0000
committerfrosch <frosch@openttd.org>2008-08-22 22:28:26 +0000
commitf2623e7c0999bd6d67a56d6c97238b779e384dc6 (patch)
tree0ad17de2af01e8baed56dea9de8aad90ee1ca5e0
parentb03fcdf323d7cd77a7f423fb94fd14471dc965a2 (diff)
downloadopenttd-f2623e7c0999bd6d67a56d6c97238b779e384dc6.tar.xz
(svn r14130) -Fix (r13961) [FS#2248]: Clear the stuck state of a train that is reversing with the first vehicle inside a depot. (michi_cc)
-rw-r--r--src/train_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 950cdd5a6..0dfa2189e 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1887,7 +1887,12 @@ static void ReverseTrainDirection(Vehicle *v)
if (crossing != INVALID_TILE) MaybeBarCrossingWithSound(crossing);
/* If we are inside a depot after reversing, don't bother with path reserving. */
- if (v->u.rail.track & TRACK_BIT_DEPOT) return;
+ if (v->u.rail.track & TRACK_BIT_DEPOT) {
+ /* Can't be stuck here as inside a depot is always a safe tile. */
+ if (HasBit(v->u.rail.flags, VRF_TRAIN_STUCK)) InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
+ ClrBit(v->u.rail.flags, VRF_TRAIN_STUCK);
+ return;
+ }
/* TrainExitDir does not always produce the desired dir for depots and
* tunnels/bridges that is needed for UpdateSignalsOnSegment. */