1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 11:59:15 +00:00

(svn r24071) -Fix [FS#5093]: Reversing trains while they were entering or leaving a depot could lead to stuck trains.

This commit is contained in:
michi_cc
2012-03-25 23:42:49 +00:00
parent 1adb9a5c85
commit f8b62a3c7a
2 changed files with 4 additions and 1 deletions

View File

@@ -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;