changeset 14728:124dfb57168d draft

(svn r19316) -Fix (r19186): Give correct error when failing to flatten land.
author alberth <alberth@openttd.org>
date Thu, 04 Mar 2010 21:35:26 +0000
parents 291451879682
children a69b9d8a22b0
files src/terraform_cmd.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/terraform_cmd.cpp
+++ b/src/terraform_cmd.cpp
@@ -385,7 +385,7 @@
 		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();