mirror of https://github.com/OpenTTD/OpenTTD
(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.release/0.4
parent
17b691188d
commit
52d25fe06f
|
@ -447,10 +447,10 @@ do_clear:;
|
||||||
}
|
}
|
||||||
|
|
||||||
cost = CheckRoadSlope(ti.tileh, &pieces, existing);
|
cost = CheckRoadSlope(ti.tileh, &pieces, existing);
|
||||||
if (CmdFailed(cost)) return_cmd_error(STR_1800_LAND_SLOPED_IN_WRONG_DIRECTION);
|
/* 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 (cost && (!_patches.build_on_slopes || _is_old_ai_player))
|
if (CmdFailed(cost) || (cost != 0 && (!_patches.build_on_slopes || _is_old_ai_player)))
|
||||||
return CMD_ERROR;
|
return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
|
||||||
|
|
||||||
if (ti.type != MP_STREET || (ti.map5 & 0xF0) != 0) {
|
if (ti.type != MP_STREET || (ti.map5 & 0xF0) != 0) {
|
||||||
cost += DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
cost += DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||||
|
|
Loading…
Reference in New Issue