changeset 8386:b61dbe67cbb3 draft

(svn r11956) -Fix [FS#1675]: Disallow building locks and docks on rapids.
author peter1138 <peter1138@openttd.org>
date Wed, 23 Jan 2008 08:47:49 +0000
parents df9c00eb5699
children 170ba96bf00e
files src/station_cmd.cpp src/water_cmd.cpp
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1954,6 +1954,9 @@
 		default: return_cmd_error(STR_304B_SITE_UNSUITABLE);
 	}
 
+	/* Docks cannot be placed on rapids */
+	if (IsRiverTile(tile)) return_cmd_error(STR_304B_SITE_UNSUITABLE);
+
 	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR;
 
 	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -285,6 +285,10 @@
 		case SLOPE_NE: dir = DIAGDIR_NE; break;
 		default: return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
 	}
+
+	/* Disallow building of locks on river rapids */
+	if (IsRiverTile(tile)) return_cmd_error(STR_0239_SITE_UNSUITABLE);
+
 	return DoBuildShiplift(tile, dir, flags);
 }