summaryrefslogtreecommitdiff
path: root/src/rail_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-01-13 19:48:33 +0000
committerfrosch <frosch@openttd.org>2009-01-13 19:48:33 +0000
commitbc06145d248d130180d39efe1b84a09ad66ddfe2 (patch)
treeab4350e93848157585230c14366d95b4cad1ed0d /src/rail_gui.cpp
parentfa31824a5f24fcc2bfe888ae1e7fa75e9e1d60bd (diff)
downloadopenttd-bc06145d248d130180d39efe1b84a09ad66ddfe2.tar.xz
(svn r15071) -Fix (r14919): When drag&dropping rail-stations with X orientation, distant-join scanned a wrong area for stations.
Diffstat (limited to 'src/rail_gui.cpp')
-rw-r--r--src/rail_gui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index cb7ac7856..87e8901e0 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -880,11 +880,14 @@ static void HandleStationPlacement(TileIndex start, TileIndex end)
w = ex - sx + 1;
h = ey - sy + 1;
- if (_railstation.orientation == AXIS_X) Swap(w, h);
+ uint numtracks = w;
+ uint platlength = h;
+ if (_railstation.orientation == AXIS_X) Swap(numtracks, platlength);
+
uint32 p1 = _cur_railtype | _railstation.orientation << 4 | _ctrl_pressed << 24;
uint32 p2 = _railstation.station_class | _railstation.station_type << 8 | INVALID_STATION << 16;
- CommandContainer cmdcont = { TileXY(sx, sy), p1 | w << 8 | h << 16, p2, CMD_BUILD_RAILROAD_STATION | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION), CcStation, "" };
+ CommandContainer cmdcont = { TileXY(sx, sy), p1 | numtracks << 8 | platlength << 16, p2, CMD_BUILD_RAILROAD_STATION | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION), CcStation, "" };
ShowSelectStationIfNeeded(cmdcont, w, h);
}