summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-13 17:37:18 +0000
committersmatz <smatz@openttd.org>2008-09-13 17:37:18 +0000
commit7dc595ca72f66e0609b3e2a2dabd7cc55569b1e1 (patch)
tree3f8ce47a27166da6b19ddb3d75e2647949437620 /src/road_cmd.cpp
parent5b14c6706450382699038d5e51ecc52a30881dc0 (diff)
downloadopenttd-7dc595ca72f66e0609b3e2a2dabd7cc55569b1e1.tar.xz
(svn r14316) -Fix: do not allow building road over level crossings and drive-through road stops in the wrong direction even when the roadtype is present
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 6d1d878c6..417c35010 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -523,10 +523,11 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
} break;
case ROAD_TILE_CROSSING:
- if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
other_bits = GetCrossingRoadBits(tile);
if (pieces & ComplementRoadBits(other_bits)) goto do_clear;
pieces = other_bits; // we need to pay for both roadbits
+
+ if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
break;
default:
@@ -578,11 +579,12 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
case MP_STATION: {
if (!IsDriveThroughStopTile(tile)) goto do_clear;
- if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
RoadBits curbits = AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(tile)));
if (pieces & ~curbits) goto do_clear;
pieces = curbits; // we need to pay for both roadbits
+
+ if (HasTileRoadType(tile, rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
} break;
case MP_TUNNELBRIDGE: