diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 1beb09d49f..2e137ea4da 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -257,15 +257,15 @@ struct BuildDocksToolbarWindow : Window { break; case DDSP_BUILD_STATION: { /* Determine the watery part of the dock. */ - DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(end_tile)); - TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(end_tile, ReverseDiagDir(dir)) : end_tile); + DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(start_tile)); + TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(start_tile, ReverseDiagDir(dir)) : start_tile); bool adjacent = _ctrl_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { - return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), end_tile, INVALID_STATION, adjacent).Succeeded(); + return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), start_tile, INVALID_STATION, adjacent).Succeeded(); } else { - return Command::Post(STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, end_tile, to_join, adjacent); + return Command::Post(STR_ERROR_CAN_T_BUILD_DOCK_HERE, CcBuildDocks, start_tile, to_join, adjacent); } }; ShowSelectStationIfNeeded(TileArea(start_tile, tile_to), proc);