From f8b62a3c7a9191238d7dbfc3681edcdb6a781d72 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sun, 25 Mar 2012 23:42:49 +0000 Subject: (svn r24071) -Fix [FS#5093]: Reversing trains while they were entering or leaving a depot could lead to stuck trains. --- src/train_cmd.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 4473c5265..101aeca0a 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2200,6 +2200,8 @@ void FreeTrainTrackReservation(const Train *v, TileIndex origin, Trackdir orig_t bool free_tile = tile != v->tile || !(IsRailStationTile(v->tile) || IsTileType(v->tile, MP_TUNNELBRIDGE)); StationID station_id = IsRailStationTile(v->tile) ? GetStationIndex(v->tile) : INVALID_STATION; + /* A train inside a depot can't have a reservation. */ + if (v->track == TRACK_BIT_DEPOT) return; /* Don't free reservation if it's not ours. */ if (TracksOverlap(GetReservedTrackbits(tile) | TrackToTrackBits(TrackdirToTrack(td)))) return; -- cgit v1.2.3-54-g00ecf