summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-05-27 01:03:59 +0000
committerglx <glx@openttd.org>2007-05-27 01:03:59 +0000
commit8c9b4ee548975f3b5db14468f3abc7a0534e4b09 (patch)
treed03d65149752ad1ff56b21b257bd3d0cfa37ab8a /src
parent8602acc4335c35f5c777114d78b7a297a52257f6 (diff)
downloadopenttd-8c9b4ee548975f3b5db14468f3abc7a0534e4b09.tar.xz
(svn r9951) -Fix: slope check was incomplete when building road over tram track (and vice-versa)
-Fix: you could build a drive-through station over a sloped road/tram track
Diffstat (limited to 'src')
-rw-r--r--src/road_cmd.cpp2
-rw-r--r--src/station_cmd.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 1d1eace2c..d9f616e66 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -358,9 +358,9 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
switch (GetRoadTileType(tile)) {
case ROAD_TILE_NORMAL:
if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
+ all_bits = GetAllRoadBits(tile);
if (!HASBIT(GetRoadTypes(tile), rt)) break;
- all_bits = GetAllRoadBits(tile);
existing = GetRoadBits(tile, rt);
if ((existing & pieces) == pieces) {
return_cmd_error(STR_1007_ALREADY_BUILT);
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index a5c53c2ac..b1b628bf9 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1279,10 +1279,9 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* Do not remove roadtypes! */
rts |= cur_rts;
- } else {
- cost = CheckFlatLandBelow(tile, 1, 1, flags, is_drive_through ? 5 << p1 : 1 << p1, NULL);
- if (CmdFailed(cost)) return cost;
}
+ cost = CheckFlatLandBelow(tile, 1, 1, flags, is_drive_through ? 5 << p1 : 1 << p1, NULL);
+ if (CmdFailed(cost)) return cost;
Station *st = NULL;