From 82fc340a0a608eb1edf8c079b4585cf0880733df Mon Sep 17 00:00:00 2001 From: alberth Date: Fri, 9 Jul 2010 12:14:02 +0000 Subject: (svn r20097) -Codechange: Share constant bitset of safe level crossing slopes. --- src/rail_cmd.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/rail_cmd.cpp') 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; -- cgit v1.2.3-54-g00ecf