Loading

Paste #p6scznosn

  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,14 @@
  14.     if (ret.Failed()) return ret;
  15.  
  16.     tile_cur += TileOffsByDiagDir(direction);
  17. -   if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) {
  18. -       return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  19. +   if (IsTileType(tile_cur, MP_TUNNELBRIDGE)) {
  20. +       if (GetTunnelBridgeTransportType(tile_cur) != TRANSPORT_WATER) {
  21. +           return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  22. +       }
  23. +   } else {
  24. +       if (!IsTileType(tile_cur, MP_WATER) && !IsBuoyTile(tile_cur) || !IsTileFlat(tile_cur) && !IsSlopeWithOneCornerRaised(GetTileSlope(tile_cur))) {
  25. +           return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
  26. +       }
  27.     }
  28.  
  29.     TileArea dock_area = TileArea(tile + ToTileIndexDiff(_dock_tileoffs_chkaround[direction]),
  30. Index: src/waypoint_cmd.cpp
  31. ===================================================================
  32. --- src/waypoint_cmd.cpp    (revision 27653)
  33. +++ src/waypoint_cmd.cpp    (working copy)
  34. @@ -297,12 +297,15 @@
  35.     Waypoint *wp = FindDeletedWaypointCloseTo(tile, STR_SV_STNAME_BUOY, OWNER_NONE);
  36.     if (wp == NULL && !Waypoint::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_STATIONS_LOADING);
  37.  
  38. +   CommandCost ret;
  39.     CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_WAYPOINT_BUOY]);
  40.     if (!IsWaterTile(tile)) {
  41. -       CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
  42. +       ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR);
  43.         if (ret.Failed()) return ret;
  44.         cost.AddCost(ret);
  45.     }
  46. +   ret = EnsureNoVehicleOnGround(tile);
  47. +   if (ret.Failed()) return ret;
  48.  
  49.     if (flags & DC_EXEC) {
  50.         if (wp == NULL) {

Version history

Revision # Author Created at
p9fb2bmxh Anonymous 05 Sep 2016, 15:43:52 UTC Diff

Comments