summaryrefslogtreecommitdiff
path: root/src/dock_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-10 16:13:51 +0000
committerrubidium <rubidium@openttd.org>2010-08-10 16:13:51 +0000
commit2a9f9b092b01f72348d24531449eab06e87bc6d3 (patch)
tree9e7e8d1f0c049142d7ee34aea564b1ff50a4455a /src/dock_gui.cpp
parent29b489a055e12033b006410d5e67a493c64ccfe2 (diff)
downloadopenttd-2a9f9b092b01f72348d24531449eab06e87bc6d3.tar.xz
(svn r20438) -Fix [FS#4022]: for docks "facing" north, i.e. having the watery part a the northern side, the joiner had an off-by-one to the north w.r.t. the station spread against the actual other (correct) building tools
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r--src/dock_gui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index d50d14fab..88d3ebcb8 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -58,7 +58,12 @@ static void PlaceDocks_Dock(TileIndex tile)
/* tile is always the land tile, so need to evaluate _thd.pos */
CommandContainer cmdcont = { tile, _ctrl_pressed, p2, CMD_BUILD_DOCK | CMD_MSG(STR_ERROR_CAN_T_BUILD_DOCK_HERE), CcBuildDocks, "" };
- ShowSelectStationIfNeeded(cmdcont, TileArea(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE));
+
+ /* Determine the watery part of the dock. */
+ DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile, NULL));
+ TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile, ReverseDiagDir(dir)) : tile);
+
+ ShowSelectStationIfNeeded(cmdcont, TileArea(tile, tile_to));
}
static void PlaceDocks_Depot(TileIndex tile)