mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(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)
This commit is contained in:
parent
2086f77dab
commit
8726c2fd99
@ -1950,9 +1950,12 @@ static void ReverseTrainDirection(Vehicle *v)
|
|||||||
!IsPbsSignal(GetSignalType(v->tile, FindFirstTrack(v->u.rail.track))));
|
!IsPbsSignal(GetSignalType(v->tile, FindFirstTrack(v->u.rail.track))));
|
||||||
|
|
||||||
if (IsRailwayStationTile(v->tile)) SetRailwayStationPlatformReservation(v->tile, TrackdirToExitdir(GetVehicleTrackdir(v)), true);
|
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. */
|
/* Do a look-ahead now in case our current tile was already a safe tile. */
|
||||||
CheckNextTrainTile(v);
|
CheckNextTrainTile(v);
|
||||||
|
} else if (v->current_order.GetType() != OT_LOADING) {
|
||||||
|
/* Do not wait for a way out when we're still loading */
|
||||||
|
MarkTrainAsStuck(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2345,8 +2345,16 @@ void Vehicle::LeaveStation()
|
|||||||
HideFillingPercent(this->fill_percent_te_id);
|
HideFillingPercent(this->fill_percent_te_id);
|
||||||
this->fill_percent_te_id = INVALID_TE_ID;
|
this->fill_percent_te_id = INVALID_TE_ID;
|
||||||
|
|
||||||
/* Trigger station animation for trains only */
|
if (this->type == VEH_TRAIN) {
|
||||||
if (this->type == VEH_TRAIN && IsTileType(this->tile, MP_STATION)) StationAnimationTrigger(st, this->tile, STAT_ANIM_TRAIN_DEPARTS);
|
/* Trigger station animation (trains only) */
|
||||||
|
if (IsTileType(this->tile, MP_STATION)) StationAnimationTrigger(st, this->tile, STAT_ANIM_TRAIN_DEPARTS);
|
||||||
|
|
||||||
|
/* Try to reserve a path when leaving the station as we
|
||||||
|
* might not be marked as wanting a reservation, e.g.
|
||||||
|
* when an overlenght train gets turned around in a station.
|
||||||
|
*/
|
||||||
|
TryPathReserve(this, true, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user