summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-11-17 19:31:44 +0000
committerKUDr <kudr@openttd.org>2006-11-17 19:31:44 +0000
commitf2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c (patch)
tree9c7682092cc873482f869cd11ccca7d20fe73bc2 /rail_cmd.c
parent532271ba65c994ee8bc93752b515b8fc918b6ab5 (diff)
downloadopenttd-f2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c.tar.xz
(svn r7195) -Feature: [FS#297, optional elrails] New patches/vehicles option 'disable electrified railways'.
(original patch by maedhros, ideas: peter1138, Darkvater, Rubidium, Patrick, Eddi|zuHause, ..)
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index 65713beb6..cb5ff4213 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -883,6 +883,9 @@ static int32 DoConvertRail(TileIndex tile, RailType totype, bool exec)
// tile is already of requested type?
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;
+
// change type.
if (exec) {
TrackBits tracks;