summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-03-03 19:15:53 +0000
committerpeter1138 <peter1138@openttd.org>2008-03-03 19:15:53 +0000
commit5049fbb08145c0b9cd20436b2f53c3395af78cdb (patch)
treed1aa30b11819536c643ae7d6e264c60d15d2babb
parent56ed79e44841609130b8b1839e71552b95f2a2cc (diff)
downloadopenttd-5049fbb08145c0b9cd20436b2f53c3395af78cdb.tar.xz
(svn r12329) -Fix [FS#1819]: Disallow building level crossings over one-way roads as this allowed competitors to remove the one-way state.
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/rail_cmd.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index fd71ef3b0..94394d1a7 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1612,6 +1612,7 @@ STR_1004_TOO_HIGH :{WHITE}Too high
STR_1005_NO_SUITABLE_RAILROAD_TRACK :{WHITE}No suitable railway track
STR_1007_ALREADY_BUILT :{WHITE}...already built
STR_1008_MUST_REMOVE_RAILROAD_TRACK :{WHITE}Must remove railway track first
+STR_ERR_CROSSING_ON_ONEWAY_ROAD :{WHITE}Road is one way or blocked
STR_100A_RAILROAD_CONSTRUCTION :{WHITE}Railway Construction
STR_TITLE_ELRAIL_CONSTRUCTION :{WHITE}Electrified Railway Construction
STR_100B_MONORAIL_CONSTRUCTION :{WHITE}Monorail Construction
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index b22d2569a..dd2a53976 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -360,6 +360,8 @@ CommandCost CmdBuildSingleRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p
if (IsNormalRoad(tile)) {
if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
+ if (GetDisallowedRoadDirections(tile) != DRD_NONE) return_cmd_error(STR_ERR_CROSSING_ON_ONEWAY_ROAD);
+
RoadTypes roadtypes = GetRoadTypes(tile);
RoadBits road = GetRoadBits(tile, ROADTYPE_ROAD);
RoadBits tram = GetRoadBits(tile, ROADTYPE_TRAM);