summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-04 06:27:20 +0000
committerfrosch <frosch@openttd.org>2010-08-04 06:27:20 +0000
commitba527ec56ef572637fa3464ad89c05162bbf6624 (patch)
tree6e5f260db0f36955dcfdb713c87daa2b47e4f089
parentb74cee45be345495e4a84424fc69bcae91f9acf9 (diff)
downloadopenttd-ba527ec56ef572637fa3464ad89c05162bbf6624.tar.xz
(svn r20357) -Fix (r20356): Call GetAllRoadBits() only if there is road.
-rw-r--r--src/station_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index ab4553715..d99f77119 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -862,7 +862,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags
} else {
bool build_over_road = is_drive_through && IsNormalRoadTile(cur_tile);
/* Road bits in the wrong direction. */
- RoadBits rb = GetAllRoadBits(cur_tile);
+ RoadBits rb = IsNormalRoadTile(cur_tile) ? GetAllRoadBits(cur_tile) : ROAD_NONE;
if (build_over_road && (rb & (axis == AXIS_X ? ROAD_Y : ROAD_X)) != 0) {
/* Someone was pedantic and *NEEDED* three fracking different error messages. */
switch (CountBits(rb)) {