Loading

Paste #p9fb2bmxh

  1. Index: src/station_cmd.cpp
  2. ===================================================================
  3. --- src/station_cmd.cpp (revision 27653)
  4. +++ src/station_cmd.cpp (working copy)
  5. @@ -12,6 +12,7 @@
  6.  #include "stdafx.h"
  7.  #include "aircraft.h"
  8.  #include "bridge_map.h"
  9. +#include "tunnelbridge_map.h"
  10.  #include "cmd_helper.h"
  11.  #include "viewport_func.h"
  12.  #include "command_func.h"
  13. @@ -2500,8 +2501,12 @@
  14.     if (ret.Failed()) return ret;
  15.  
  16.     tile_cur += TileOffsByDiagDir(direction);
  17. -   if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) {
  18. +   if (IsTileType(tile_cur, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(tile_cur) != TRANSPORT_WATER) {
  19.         return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  20. +   } else {
  21. +       if (!IsTileType(tile_cur, MP_WATER) && !IsBuoyTile(tile_cur) || !IsTileFlat(tile_cur) && !IsSlopeWithOneCornerRaised(GetTileSlope(tile_cur))) {
  22. +           return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  23. +       }
  24.     }
  25.  
  26.     TileArea dock_area = TileArea(tile + ToTileIndexDiff(_dock_tileoffs_chkaround[direction]),
  27. Index: src/vehicle.cpp
  28. ===================================================================
  29. --- src/vehicle.cpp (revision 27653)
  30. +++ src/vehicle.cpp (working copy)
  31. @@ -481,7 +481,7 @@
  32.      */
  33.     Vehicle *v = VehicleFromPos(tile, &z, &EnsureNoVehicleProcZ, true);
  34.     if (v != NULL) return_cmd_error(STR_ERROR_TRAIN_IN_THE_WAY + v->type);
  35. -   return CommandCost();
  36. +return CommandCost();
  37.  }
  38.  
  39.  /** Procedure called for every vehicle found in tunnel/bridge in the hash map */
  40. Index: src/waypoint_cmd.cpp
  41. ===================================================================
  42. --- src/waypoint_cmd.cpp    (revision 27653)
  43. +++ src/waypoint_cmd.cpp    (working copy)
  44. @@ -297,12 +297,15 @@
  45.     Waypoint *wp = FindDeletedWaypointCloseTo(tile, STR_SV_STNAME_BUOY, OWNER_NONE);
  46.     if (wp == NULL && !Waypoint::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_STATIONS_LOADING);
  47.  
  48. +   CommandCost ret;
  49.     CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_WAYPOINT_BUOY]);
  50.     if (!IsWaterTile(tile)) {
  51. -       CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
  52. +       ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
  53.         if (ret.Failed()) return ret;
  54.         cost.AddCost(ret);
  55.     }
  56. +   ret = EnsureNoVehicleOnGround(tile);
  57. +   if (ret.Failed()) return ret;
  58.  
  59.     if (flags & DC_EXEC) {
  60.         if (wp == NULL) {

Comments