summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index c61503fe6..2eb8b056f 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -408,12 +408,8 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
}
case MP_ROAD: {
-#define M(x) (1 << (x))
/* Level crossings may only be built on these slopes */
- if (!HasBit(M(SLOPE_SEN) | M(SLOPE_ENW) | M(SLOPE_NWS) | M(SLOPE_NS) | M(SLOPE_WSE) | M(SLOPE_EW) | M(SLOPE_FLAT), tileh)) {
- return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
- }
-#undef M
+ if (!HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh)) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
CommandCost ret = EnsureNoVehicleOnGround(tile);
if (ret.Failed()) return ret;