summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 87099bf03..7de77721e 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1358,6 +1358,9 @@ int32 DoConvertStationRail(TileIndex tile, RailType totype, bool exec)
if (GetRailType(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 && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
+
if (exec) {
SetRailType(tile, totype);
MarkTileDirtyByTile(tile);