summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-04-26 21:44:22 +0000
committerDarkvater <darkvater@openttd.org>2006-04-26 21:44:22 +0000
commit939dd7d2bf4da9adfe71e0a4294dc419663d0b0e (patch)
tree564be4ce4bba781323ba5d3988f2454396337d4b
parent6a31b30a2091ea4f139b222778b5d435335ad828 (diff)
downloadopenttd-939dd7d2bf4da9adfe71e0a4294dc419663d0b0e.tar.xz
(svn r4585) - Fix [FS#130] - Obscure road dragging bug. The road build command did not return the appropiate error message of invalid-slope when building road.
-rw-r--r--road_cmd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/road_cmd.c b/road_cmd.c
index aa1be9514..5c8589da3 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -386,10 +386,11 @@ do_clear:;
}
ret = CheckRoadSlope(tileh, &pieces, existing);
- if (CmdFailed(ret)) return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
- if (ret != 0 && (!_patches.build_on_slopes || _is_old_ai_player)) {
- return CMD_ERROR;
- }
+ /* Return an error if we need to build a foundation (ret != 0) but the
+ * current patch-setting is turned off (or stupid AI@work) */
+ if (CmdFailed(ret) || ret != 0 && (!_patches.build_on_slopes || _is_old_ai_player))
+ return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
+
cost += ret;
if (IsTileType(tile, MP_STREET)) {