Mercurial > hg > openttd
diff src/train_cmd.cpp @ 9891:95fb811fb1d3 draft
(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)
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 10 Aug 2008 21:56:47 +0000 (2008-08-10) |
parents | b849464ebe27 |
children | 29d461128c75 |
line wrap: on
line diff
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1950,9 +1950,12 @@ !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); } } }