summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-05 17:53:01 +0000
committerrubidium <rubidium@openttd.org>2007-10-05 17:53:01 +0000
commitea433ffc640d2f9f5eff6c9cbd111b544a1ac54a (patch)
tree61037e556e0a1dd552fe3c7d0196ac6cca36ad1c /src/road_cmd.cpp
parentd8c029825054e65acd3c55df2a586665ee70c197 (diff)
downloadopenttd-ea433ffc640d2f9f5eff6c9cbd111b544a1ac54a.tar.xz
(svn r11206) -Fix [FS#1299]: half tram bits could be removed in some cases. Based on patches by frosch and skidd13.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 2149b6270..eaf98c499 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -836,10 +836,9 @@ static CommandCost ClearTile_Road(TileIndex tile, byte flags)
case ROAD_TILE_NORMAL: {
RoadBits b = GetAllRoadBits(tile);
-#define M(x) (1 << (x))
/* Clear the road if only one piece is on the tile OR the AI tries
* to clear town road OR we are not using the DC_AUTO flag */
- if ((M(b) & (M(ROAD_NW) | M(ROAD_SW) | M(ROAD_SE) | M(ROAD_NE))) ||
+ if ((COUNTBITS(b) == 1 && GetRoadBits(tile, ROADTYPE_TRAM) == ROAD_NONE) ||
((flags & DC_AI_BUILDING) && IsTileOwner(tile, OWNER_TOWN)) ||
!(flags & DC_AUTO)
) {
@@ -856,7 +855,6 @@ static CommandCost ClearTile_Road(TileIndex tile, byte flags)
}
return_cmd_error(STR_1801_MUST_REMOVE_ROAD_FIRST);
}
-#undef M
case ROAD_TILE_CROSSING: {
RoadTypes rts = GetRoadTypes(tile);