summaryrefslogtreecommitdiff
path: root/src/terraform_cmd.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-03-04 21:35:26 +0000
committeralberth <alberth@openttd.org>2010-03-04 21:35:26 +0000
commitf747b980c6580e00be48e6c54d567a8470f1c01d (patch)
tree8d2b957f071d2bcbc667e7112186e5e65d63b625 /src/terraform_cmd.cpp
parent4d5125f0c4849c481bff00ada51e4f236c466ea1 (diff)
downloadopenttd-f747b980c6580e00be48e6c54d567a8470f1c01d.tar.xz
(svn r19316) -Fix (r19186): Give correct error when failing to flatten land.
Diffstat (limited to 'src/terraform_cmd.cpp')
-rw-r--r--src/terraform_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp
index ef487afc5..5bad78fdf 100644
--- a/src/terraform_cmd.cpp
+++ b/src/terraform_cmd.cpp
@@ -385,7 +385,7 @@ CommandCost CmdLevelLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
uint curh = TileHeight(tile);
while (curh != h) {
CommandCost ret = DoCommand(tile, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
- if (ret.Failed()) break;
+ if (ret.Failed()) return (cost.GetCost() == 0) ? ret : cost;
if (flags & DC_EXEC) {
money -= ret.GetCost();