From bab70a823dd810e1d4477f0c01d3a7b3e9b19ac8 Mon Sep 17 00:00:00 2001 From: alberth Date: Mon, 1 Jun 2009 11:43:36 +0000 Subject: (svn r16491) -Codechange: Added parentheses around bitwise operators for code style. --- src/road_cmd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/road_cmd.cpp') diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 680b8d000..dddc609c0 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -137,10 +137,10 @@ bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, RoadType /* Get a bitmask of which neighbouring roads has a tile */ RoadBits n = ROAD_NONE; RoadBits present = GetAnyRoadBits(tile, rt); - if (present & ROAD_NE && GetAnyRoadBits(TILE_ADDXY(tile, -1, 0), rt) & ROAD_SW) n |= ROAD_NE; - if (present & ROAD_SE && GetAnyRoadBits(TILE_ADDXY(tile, 0, 1), rt) & ROAD_NW) n |= ROAD_SE; - if (present & ROAD_SW && GetAnyRoadBits(TILE_ADDXY(tile, 1, 0), rt) & ROAD_NE) n |= ROAD_SW; - if (present & ROAD_NW && GetAnyRoadBits(TILE_ADDXY(tile, 0, -1), rt) & ROAD_SE) n |= ROAD_NW; + if ((present & ROAD_NE) && (GetAnyRoadBits(TILE_ADDXY(tile, -1, 0), rt) & ROAD_SW)) n |= ROAD_NE; + if ((present & ROAD_SE) && (GetAnyRoadBits(TILE_ADDXY(tile, 0, 1), rt) & ROAD_NW)) n |= ROAD_SE; + if ((present & ROAD_SW) && (GetAnyRoadBits(TILE_ADDXY(tile, 1, 0), rt) & ROAD_NE)) n |= ROAD_SW; + if ((present & ROAD_NW) && (GetAnyRoadBits(TILE_ADDXY(tile, 0, -1), rt) & ROAD_SE)) n |= ROAD_NW; int rating_decrease = RATING_ROAD_DOWN_STEP_EDGE; /* If 0 or 1 bits are set in n, or if no bits that match the bits to remove, @@ -494,7 +494,7 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR; /* Ignore half built tiles */ - if (flags & DC_EXEC && rt != ROADTYPE_TRAM && IsStraightRoad(existing)) { + if ((flags & DC_EXEC) && rt != ROADTYPE_TRAM && IsStraightRoad(existing)) { SetDisallowedRoadDirections(tile, GetDisallowedRoadDirections(tile) ^ toggle_drd); MarkTileDirtyByTile(tile); } -- cgit v1.2.3-54-g00ecf