summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-03 19:22:23 +0000
committerrubidium <rubidium@openttd.org>2007-06-03 19:22:23 +0000
commit6a60ba3eaa66b5e226525f2dec4896014657be4e (patch)
tree2f9281929857522e874d8400400deca2d711df00 /src
parenta752c73469e2a5e1d3f7b5b30b2db494e4bdbae5 (diff)
downloadopenttd-6a60ba3eaa66b5e226525f2dec4896014657be4e.tar.xz
(svn r10030) -Fix [FS#823]: one could build on (some) slopes when building on slopes was disabled.
Diffstat (limited to 'src')
-rw-r--r--src/rail_cmd.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 66036ab36..16d95eaeb 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -206,20 +206,17 @@ static uint32 CheckRailSlope(Slope tileh, TrackBits rail_bits, TrackBits existin
}
/* no special foundation */
- if ((~_valid_tileh_slopes[0][tileh] & rail_bits) == 0)
+ if ((~_valid_tileh_slopes[0][tileh] & rail_bits) == 0) {
return 0;
+ } else if (!_patches.build_on_slopes || _is_old_ai_player) {
+ return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
+ }
if ((~_valid_tileh_slopes[1][tileh] & rail_bits) == 0 || ( // whole tile is leveled up
(rail_bits == TRACK_BIT_X || rail_bits == TRACK_BIT_Y) &&
(tileh == SLOPE_W || tileh == SLOPE_S || tileh == SLOPE_E || tileh == SLOPE_N)
)) { // partly up
- if (existing != 0) {
- return 0;
- } else if (!_patches.build_on_slopes || _is_old_ai_player) {
- return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
- } else {
- return _price.terraform;
- }
+ return (existing != 0) ? 0 : _price.terraform;
}
}
return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);