summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 37334c0eb..1ecdff208 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3695,6 +3695,8 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image)
return;
}
goto reverse_train_direction;
+ } else {
+ TryReserveRailTrack(gp.new_tile, TrackBitsToTrack(chosen_track));
}
} else {
static const TrackBits _matching_tracks[8] = {
@@ -3777,7 +3779,10 @@ static void TrainController(Vehicle *v, Vehicle *nomove, bool update_image)
if (IsTileType(gp.new_tile, MP_TUNNELBRIDGE) && HasBit(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
/* Perform look-ahead on tunnel exit. */
- if (IsFrontEngine(v)) CheckNextTrainTile(v);
+ if (IsFrontEngine(v)) {
+ TryReserveRailTrack(gp.new_tile, DiagDirToDiagTrack(GetTunnelBridgeDirection(gp.new_tile)));
+ CheckNextTrainTile(v);
+ }
} else {
v->x_pos = gp.x;
v->y_pos = gp.y;