summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/train_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 2e9f39bc3..6b71962a1 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3242,7 +3242,7 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
if ((ts &= (ts >> 16)) == 0) {
/* make a rail/road crossing red
* do not make crossing red behind depot the train is entering */
- if (IsLevelCrossingTile(tile) && (GetRailTileType(v->tile) != RAIL_TILE_DEPOT || GetRailDepotDirection(v->tile) == dir)) {
+ if (IsLevelCrossingTile(tile) && (!IsTileDepotType(v->tile, TRANSPORT_RAIL) || GetRailDepotDirection(v->tile) == dir)) {
if (!IsCrossingBarred(tile)) {
BarCrossing(tile);
SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v);