diff options
author | rubidium <rubidium@openttd.org> | 2011-11-04 10:30:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-04 10:30:10 +0000 |
commit | 1dc685aeea202f1677f915d390dc13ce3e18c462 (patch) | |
tree | 2cacacd88d133fa3bbbe11c706dcf21f841898d0 /src/road_cmd.cpp | |
parent | 0b6dbaf6645644be09d101b15806a13479610fda (diff) | |
download | openttd-1dc685aeea202f1677f915d390dc13ce3e18c462.tar.xz |
(svn r23100) -Codechange: remove pointless multiplications by TILE_HEIGHT for the terraform code
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 4b506d912..c45ff7b28 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1682,7 +1682,7 @@ static CommandCost TerraformTile_Road(TileIndex tile, DoCommandFlag flags, uint if (_settings_game.construction.build_on_slopes && AutoslopeEnabled()) { switch (GetRoadTileType(tile)) { case ROAD_TILE_CROSSING: - if (!IsSteepSlope(tileh_new) && (GetTileMaxPixelZ(tile) == z_new + GetSlopeMaxPixelZ(tileh_new)) && HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); + if (!IsSteepSlope(tileh_new) && (GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new)) && HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); break; case ROAD_TILE_DEPOT: @@ -1697,11 +1697,11 @@ static CommandCost TerraformTile_Road(TileIndex tile, DoCommandFlag flags, uint /* CheckRoadSlope() sometimes changes the road_bits, if it does not agree with them. */ if (bits == bits_copy) { uint z_old; - Slope tileh_old = GetTilePixelSlope(tile, &z_old); + Slope tileh_old = GetTileSlope(tile, &z_old); /* Get the slope on top of the foundation */ - z_old += ApplyPixelFoundationToSlope(GetRoadFoundation(tileh_old, bits), &tileh_old); - z_new += ApplyPixelFoundationToSlope(GetRoadFoundation(tileh_new, bits), &tileh_new); + z_old += ApplyFoundationToSlope(GetRoadFoundation(tileh_old, bits), &tileh_old); + z_new += ApplyFoundationToSlope(GetRoadFoundation(tileh_new, bits), &tileh_new); /* The surface slope must not be changed */ if ((z_old == z_new) && (tileh_old == tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); |