From 52d25fe06ff1e02c8edaa5163a3af653d15a1e13 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 2 May 2006 13:58:43 +0000 Subject: [PATCH] (svn r4682) - Backport from trunk (r4585, r4950): Fix: Obscure road dragging bug. The road build command did not return the appropiate error message of invalid-slope when building road. --- road_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/road_cmd.c b/road_cmd.c index 462d1a7a09..2258553b4c 100644 --- a/road_cmd.c +++ b/road_cmd.c @@ -447,10 +447,10 @@ do_clear:; } cost = CheckRoadSlope(ti.tileh, &pieces, existing); - if (CmdFailed(cost)) return_cmd_error(STR_1800_LAND_SLOPED_IN_WRONG_DIRECTION); - - if (cost && (!_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(cost) || (cost != 0 && (!_patches.build_on_slopes || _is_old_ai_player))) + return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION); if (ti.type != MP_STREET || (ti.map5 & 0xF0) != 0) { cost += DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);