Index: src/station_cmd.cpp
===================================================================
--- src/station_cmd.cpp (revision 27653)
+++ src/station_cmd.cpp (working copy)
@@ -12,6 +12,7 @@
#include "stdafx.h"
#include "aircraft.h"
#include "bridge_map.h"
+#include "tunnelbridge_map.h"
#include "cmd_helper.h"
#include "viewport_func.h"
#include "command_func.h"
@@ -2500,8 +2501,14 @@
if (ret.Failed()) return ret;
tile_cur += TileOffsByDiagDir(direction);
- if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) {
- return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
+ if (IsTileType(tile_cur, MP_TUNNELBRIDGE)) {
+ if (GetTunnelBridgeTransportType(tile_cur) != TRANSPORT_WATER) {
+ return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
+ }
+ } else {
+ if (!IsTileType(tile_cur, MP_WATER) && !IsBuoyTile(tile_cur) || !IsTileFlat(tile_cur) && !IsSlopeWithOneCornerRaised(GetTileSlope(tile_cur))) {
+ return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
+ }
}
TileArea dock_area = TileArea(tile + ToTileIndexDiff(_dock_tileoffs_chkaround[direction]),
Index: src/waypoint_cmd.cpp
===================================================================
--- src/waypoint_cmd.cpp (revision 27653)
+++ src/waypoint_cmd.cpp (working copy)
@@ -297,12 +297,15 @@
Waypoint *wp = FindDeletedWaypointCloseTo(tile, STR_SV_STNAME_BUOY, OWNER_NONE);
if (wp == NULL && !Waypoint::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_STATIONS_LOADING);
+ CommandCost ret;
CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_WAYPOINT_BUOY]);
if (!IsWaterTile(tile)) {
- CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
+ ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
cost.AddCost(ret);
}
+ ret = EnsureNoVehicleOnGround(tile);
+ if (ret.Failed()) return ret;
if (flags & DC_EXEC) {
if (wp == NULL) {