From fa68e5f77026835b02e1dc3d8eef09b57aac8249 Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 2 Apr 2008 14:13:15 +0000 Subject: (svn r12541) -Codechange: Declare Slope enum as bit set, and remove some (then) unneeded casts. --- src/terraform_cmd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/terraform_cmd.cpp') diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index 27c8eb481..5e7e486b5 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -287,11 +287,11 @@ CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) uint z_max = max(max(z_N, z_W), max(z_S, z_E)); /* Compute tile slope */ - uint tileh = (z_max > z_min + 1 ? SLOPE_STEEP : SLOPE_FLAT); - if (z_W > z_min) tileh += SLOPE_W; - if (z_S > z_min) tileh += SLOPE_S; - if (z_E > z_min) tileh += SLOPE_E; - if (z_N > z_min) tileh += SLOPE_N; + Slope tileh = (z_max > z_min + 1 ? SLOPE_STEEP : SLOPE_FLAT); + if (z_W > z_min) tileh |= SLOPE_W; + if (z_S > z_min) tileh |= SLOPE_S; + if (z_E > z_min) tileh |= SLOPE_E; + if (z_N > z_min) tileh |= SLOPE_N; /* Check if bridge would take damage */ if (direction == 1 && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile) && @@ -305,7 +305,7 @@ CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); } /* Check tiletype-specific things, and add extra-cost */ - CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, (Slope) tileh); + CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, tileh); if (CmdFailed(cost)) { _terraform_err_tile = tile; return cost; -- cgit v1.2.3-54-g00ecf