summaryrefslogtreecommitdiff
path: root/road_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 7828d0abc..5f0276c16 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -430,6 +430,9 @@ int32 DoConvertStreetRail(TileIndex tile, RailType totype, bool exec)
if (GetRailTypeCrossing(tile) == totype) return CMD_ERROR;
+ // 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
+ if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailTypeCrossing(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
+
if (exec) {
SetRailTypeCrossing(tile, totype);
MarkTileDirtyByTile(tile);