diff options
author | frosch <frosch@openttd.org> | 2008-04-02 14:13:15 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-04-02 14:13:15 +0000 |
commit | fa68e5f77026835b02e1dc3d8eef09b57aac8249 (patch) | |
tree | 1c88a7fa03add5b3c621da72df5f777b12fdd26c /src/terraform_cmd.cpp | |
parent | 5e5e074a5dc68ed495de3234fda15989db34e23d (diff) | |
download | openttd-fa68e5f77026835b02e1dc3d8eef09b57aac8249.tar.xz |
(svn r12541) -Codechange: Declare Slope enum as bit set, and remove some (then) unneeded casts.
Diffstat (limited to 'src/terraform_cmd.cpp')
-rw-r--r-- | src/terraform_cmd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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; |