summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/station_cmd.cpp9
-rw-r--r--src/train_cmd.cpp1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index baa3392c3..68eec417f 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1031,6 +1031,9 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1,
if (v != NULL) {
FreeTrainTrackReservation(v);
*affected_vehicles.Append() = v;
+ if (IsRailwayStationTile(v->tile)) SetRailwayStationPlatformReservation(v->tile, TrackdirToExitdir(GetVehicleTrackdir(v)), false);
+ for (; v->Next() != NULL; v = v->Next()) ;
+ if (IsRailwayStationTile(v->tile)) SetRailwayStationPlatformReservation(v->tile, TrackdirToExitdir(ReverseTrackdir(GetVehicleTrackdir(v))), false);
}
}
@@ -1059,7 +1062,11 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1,
} while (--numtracks);
for (uint i = 0; i < affected_vehicles.Length(); ++i) {
- TryPathReserve(affected_vehicles[i], true);
+ Vehicle *v = affected_vehicles[i];
+ if (IsRailwayStationTile(v->tile)) SetRailwayStationPlatformReservation(v->tile, TrackdirToExitdir(GetVehicleTrackdir(v)), true);
+ TryPathReserve(v, true);
+ for (; v->Next() != NULL; v = v->Next()) ;
+ if (IsRailwayStationTile(v->tile)) SetRailwayStationPlatformReservation(v->tile, TrackdirToExitdir(ReverseTrackdir(GetVehicleTrackdir(v))), true);
}
st->MarkTilesDirty(false);
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 95c9b613c..37334c0eb 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1949,6 +1949,7 @@ static void ReverseTrainDirection(Vehicle *v)
HasSignalOnTrackdir(v->tile, GetVehicleTrackdir(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)) {
/* Do a look-ahead now in case our current tile was already a safe tile. */
CheckNextTrainTile(v);