From 8b9bcf4adc99ccbaa87263ebe09b2338d860ef29 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 26 Nov 2021 15:47:43 +0100 Subject: [PATCH] Fix #16008: Can select elements when no tile selected --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/TileInspector.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d246888c71..fdb9c4dee9 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,6 +4,7 @@ - Feature: [#714] Allow up to 255 trains per ride. - Feature: [#2253] Path surfaces and railings can be mixed and matched, like in RCT1. - Improved: [#10664] Invisibility status is now shown in the Tile Inspector. +- Fix: [#16008] Tile Inspector can select elements from last tile without reselecting it. 0.3.5.1 (2021-11-21) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index bfc83a3963..a5c65d7a21 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1337,6 +1337,10 @@ static void WindowTileInspectorSetPage(rct_window* w, const TileInspectorPage pa static void WindowTileInspectorScrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { + // There is nothing to interact with when no tile is selected + if (!windowTileInspectorTileSelected) + return; + // Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1; WindowTileInspectorSelectElementFromList(w, index);