diff options
author | rubidium <rubidium@openttd.org> | 2008-08-10 21:56:47 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-10 21:56:47 +0000 |
commit | 8726c2fd998b2c1f3f8020c9bd94904603b7e5a8 (patch) | |
tree | 2e36442017c9adc7289659c972b56c53ac66f37d /src/train_cmd.cpp | |
parent | 2086f77daba836dc6cdb5204060adbca8e7377f3 (diff) | |
download | openttd-8726c2fd998b2c1f3f8020c9bd94904603b7e5a8.tar.xz |
(svn r14039) -Fix [FS#2217]: reversing an overlength train at a station would try to find a route out and sometimes reset the unload counter making it wait 2.5 years before departing instead of waiting until the train would actually leave the station (michi_cc)
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 1ecdff208..8bb89bd6f 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1950,9 +1950,12 @@ static void ReverseTrainDirection(Vehicle *v) !IsPbsSignal(GetSignalType(v->tile, FindFirstTrack(v->u.rail.track)))); if (IsRailwayStationTile(v->tile)) SetRailwayStationPlatformReservation(v->tile, TrackdirToExitdir(GetVehicleTrackdir(v)), true); - if (TryPathReserve(v, true, first_tile_okay)) { + if (TryPathReserve(v, false, first_tile_okay)) { /* Do a look-ahead now in case our current tile was already a safe tile. */ CheckNextTrainTile(v); + } else if (v->current_order.GetType() != OT_LOADING) { + /* Do not wait for a way out when we're still loading */ + MarkTrainAsStuck(v); } } } |