summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
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;