src/train_cmd.cpp
changeset 9973 6ec0621a124d
parent 9941 8549448b55fa
child 9974 49ed9790d079
--- a/src/train_cmd.cpp	Fri Aug 22 22:19:23 2008 +0000
+++ b/src/train_cmd.cpp	Fri Aug 22 22:28:26 2008 +0000
@@ -1887,7 +1887,12 @@
 	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. */