summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-04 20:33:22 +0000
committerrubidium <rubidium@openttd.org>2011-01-04 20:33:22 +0000
commit73d26d3831bb5c250cbb4d29a79dd1444c31b22c (patch)
tree631dafe23c659f27de835d55dda2676e9ddc93d0 /src
parent017a7f902bbae61c2aae653fb7e0400d420321a8 (diff)
downloadopenttd-73d26d3831bb5c250cbb4d29a79dd1444c31b22c.tar.xz
(svn r21714) -Codechange: unduplicate a bit of code path
Diffstat (limited to 'src')
-rw-r--r--src/landscape.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 18b8343a3..2b7e17369 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -629,10 +629,10 @@ CommandCost CmdLandscapeClear(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
if ((flags & DC_NO_WATER) && HasTileWaterClass(tile) && IsTileOnWater(tile)) {
return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
}
- if (do_clear && (flags & DC_EXEC)) DoClearSquare(tile);
- return cost;
+ } else {
+ cost.AddCost(_tile_type_procs[GetTileType(tile)]->clear_tile_proc(tile, flags));
}
- cost.AddCost(_tile_type_procs[GetTileType(tile)]->clear_tile_proc(tile, flags));
+
if (do_clear && (flags & DC_EXEC)) DoClearSquare(tile);
return cost;
}