1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 10:15:36 +01:00

Fix #16008: Can select elements when no tile selected

This commit is contained in:
Hielke Morsink
2021-11-26 15:47:43 +01:00
committed by GitHub
parent 90d2be3ddd
commit 8b9bcf4adc
2 changed files with 5 additions and 0 deletions

View File

@@ -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);