summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-07-28 22:23:28 +0000
committermichi_cc <michi_cc@openttd.org>2010-07-28 22:23:28 +0000
commite8cabbdc56c08f17f39319992eaf062e4dc2fed6 (patch)
tree40d6624ac73be480f98bb124f07ea21e292f5983 /src
parent90c4066397f0f990c777198bf178d62df14e17e0 (diff)
downloadopenttd-e8cabbdc56c08f17f39319992eaf062e4dc2fed6.tar.xz
(svn r20237) -Fix (r20049): Check for disallowed level crossings also when converting rail.
Diffstat (limited to 'src')
-rw-r--r--src/rail_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index c2a7c74c8..f3c290a1b 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1417,6 +1417,10 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
break;
case MP_ROAD:
if (!IsLevelCrossing(tile)) continue;
+ if (RailNoLevelCrossings(totype)) {
+ error.MakeError(STR_ERROR_CROSSING_DISALLOWED);
+ continue;
+ }
break;
case MP_TUNNELBRIDGE:
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) continue;