summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-12-25 14:59:53 +0000
committerfrosch <frosch@openttd.org>2016-12-25 14:59:53 +0000
commit6f8241d8e9d8cd54a7d41beda983ded831de8176 (patch)
tree0e9f93f2f62d337b0f13a268d81c7a694964a072
parent4342798ff5100c8b5974c8c41c7b4f667f09883d (diff)
downloadopenttd-6f8241d8e9d8cd54a7d41beda983ded831de8176.tar.xz
(svn r27710) -Change: Limit waypoint area by maximum station spread already when dragging. (adf88)
-rw-r--r--src/rail_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index e1602db0c..73fe29da0 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -161,7 +161,8 @@ static void PlaceRail_Waypoint(TileIndex tile)
Axis axis = GetAxisForNewWaypoint(tile);
if (IsValidAxis(axis)) {
/* Valid tile for waypoints */
- VpStartPlaceSizing(tile, axis == AXIS_X ? VPM_FIX_X : VPM_FIX_Y, DDSP_BUILD_STATION);
+ VpStartPlaceSizing(tile, axis == AXIS_X ? VPM_X_LIMITED : VPM_Y_LIMITED, DDSP_BUILD_STATION);
+ VpSetPlaceSizingLimit(_settings_game.station.station_spread);
} else {
/* Tile where we can't build rail waypoints. This is always going to fail,
* but provides the user with a proper error message. */
@@ -728,7 +729,7 @@ struct BuildRailToolbarWindow : Window {
DoCommandP(end_tile, start_tile, _ctrl_pressed ? 0 : 1, CMD_REMOVE_FROM_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT), CcPlaySound_SPLAT_RAIL);
} else {
TileArea ta(start_tile, end_tile);
- uint32 p1 = _cur_railtype | (select_method == VPM_FIX_X ? AXIS_X : AXIS_Y) << 4 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24;
+ uint32 p1 = _cur_railtype | (select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y) << 4 | ta.w << 8 | ta.h << 16 | _ctrl_pressed << 24;
uint32 p2 = STAT_CLASS_WAYP | _cur_waypoint_type << 8 | INVALID_STATION << 16;
CommandContainer cmdcont = { ta.tile, p1, p2, CMD_BUILD_RAIL_WAYPOINT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT), CcPlaySound_SPLAT_RAIL, "" };