tunnelbridge_cmd.c
changeset 5116 2a33a74925c5
parent 5057 f266cc90b396
child 5400 5cb194d32614
child 5573 afa6f92a71fd
--- a/tunnelbridge_cmd.c	Fri Nov 17 18:06:40 2006 +0000
+++ b/tunnelbridge_cmd.c	Fri Nov 17 19:31:44 2006 +0000
@@ -772,6 +772,9 @@
 
 		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;
+
 		endtile = CheckTunnelBusy(tile, &length);
 		if (endtile == INVALID_TILE) return CMD_ERROR;