mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-08 23:19:40 +00:00
(svn r20357) -Fix (r20356): Call GetAllRoadBits() only if there is road.
This commit is contained in:
parent
b74cee45be
commit
ba527ec56e
@ -862,7 +862,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags
|
|||||||
} else {
|
} else {
|
||||||
bool build_over_road = is_drive_through && IsNormalRoadTile(cur_tile);
|
bool build_over_road = is_drive_through && IsNormalRoadTile(cur_tile);
|
||||||
/* Road bits in the wrong direction. */
|
/* 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) {
|
if (build_over_road && (rb & (axis == AXIS_X ? ROAD_Y : ROAD_X)) != 0) {
|
||||||
/* Someone was pedantic and *NEEDED* three fracking different error messages. */
|
/* Someone was pedantic and *NEEDED* three fracking different error messages. */
|
||||||
switch (CountBits(rb)) {
|
switch (CountBits(rb)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user