From 0268be92cb15439824d7837dacfc715e8cbd9002 Mon Sep 17 00:00:00 2001 From: Jeroen D Stout Date: Sun, 1 Oct 2017 00:48:20 +0200 Subject: [PATCH] Prevent ride construction from setting tiles when scenery tool is active --- src/openrct2-ui/windows/RideConstruction.cpp | 7 +++++++ src/openrct2/ride/Ride.cpp | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 1a0b4c750a..49fa12ae2c 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -3140,6 +3140,13 @@ static void window_ride_construction_update_widgets(rct_window *w) static void window_ride_construction_select_map_tiles(Ride *ride, sint32 trackType, sint32 trackDirection, sint32 x, sint32 y) { + // If the scenery tool is active, we do not display our tiles as it + // will conflict with larger scenery objects selecting tiles + if (scenery_tool_is_active()) + { + return; + } + const rct_preview_track *trackBlock; sint32 offsetX, offsetY; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 74f4b6b497..0a95a8e8b0 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1655,8 +1655,11 @@ void ride_select_next_section() if (track_block_get_next(&inputElement, &outputElement, &z, &direction)) { x = outputElement.x; y = outputElement.y; - map_set_virtual_floor_height(tileElement->base_height << 3); tileElement = outputElement.element; + if (!scenery_tool_is_active()) + { + map_set_virtual_floor_height(tileElement->base_height << 3); + } } else { _rideConstructionState = RIDE_CONSTRUCTION_STATE_FRONT; _currentTrackBeginX = outputElement.x; @@ -1714,7 +1717,10 @@ void ride_select_previous_section() _currentTrackPieceType = track_element_get_type(trackBeginEnd.begin_element); _currentTrackSelectionFlags = 0; _rideConstructionArrowPulseTime = 0; - map_set_virtual_floor_height(trackBeginEnd.end_element->base_height << 3); + if (!scenery_tool_is_active()) + { + map_set_virtual_floor_height(trackBeginEnd.begin_element->base_height << 3); + } window_ride_construction_update_active_elements(); } else { _rideConstructionState = RIDE_CONSTRUCTION_STATE_BACK;