summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index d8ac7a051..b23c6e9e4 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2542,7 +2542,8 @@ static bool CheckCompatibleRail(const Vehicle *v, TileIndex tile)
return
IsTileOwner(tile, v->owner) &&
- (v->subtype != TS_Front_Engine || (_map3_lo[tile] & 0xF) == v->u.rail.railtype);
+ (v->subtype != TS_Front_Engine ||
+ IsCompatibleRail(v->u.rail.railtype, GetRailType(tile)));
}
typedef struct {