summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/train_cmd.cpp5
-rw-r--r--src/vehicle.cpp12
2 files changed, 14 insertions, 3 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);
}
}
}
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 555f1ddf0..305544137 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -2345,8 +2345,16 @@ void Vehicle::LeaveStation()
HideFillingPercent(this->fill_percent_te_id);
this->fill_percent_te_id = INVALID_TE_ID;
- /* Trigger station animation for trains only */
- if (this->type == VEH_TRAIN && IsTileType(this->tile, MP_STATION)) StationAnimationTrigger(st, this->tile, STAT_ANIM_TRAIN_DEPARTS);
+ if (this->type == VEH_TRAIN) {
+ /* 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);
+ }
}