1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-26 16:09:10 +00:00

(svn r20098) -Fix [FS#3898]: A train reversing in a station would sometimes fail to release its reserved path.

This commit is contained in:
michi_cc
2010-07-09 14:14:17 +00:00
parent 82fc340a0a
commit 811f0db597
3 changed files with 13 additions and 6 deletions

View File

@@ -3808,8 +3808,17 @@ static bool TrainLocoHandler(Train *v, bool mode)
v->wait_counter = 0;
v->cur_speed = 0;
v->subspeed = 0;
ClrBit(v->flags, VRF_LEAVING_STATION);
ReverseTrainDirection(v);
return true;
} else if (HasBit(v->flags, VRF_LEAVING_STATION)) {
/* Try to reserve a path when leaving the station as we
* might not be marked as wanting a reservation, e.g.
* when an overlength train gets turned around in a station. */
if (UpdateSignalsOnSegment(v->tile, TrackdirToExitdir(v->GetVehicleTrackdir()), v->owner) == SIGSEG_PBS || _settings_game.pf.reserve_paths) {
TryPathReserve(v, true, true);
}
ClrBit(v->flags, VRF_LEAVING_STATION);
}
v->HandleLoading(mode);