From 8de672bc82128e4ddf9f25fa6b124a754fd616e9 Mon Sep 17 00:00:00 2001 From: rinode Date: Tue, 28 Apr 2026 22:00:37 +0200 Subject: [PATCH] Fix #26462: Opening Tile Inspector crashes the game --- src/openrct2-ui/windows/TileInspector.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 2ea53b250d..5bbfd27bfa 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -474,16 +474,21 @@ namespace OpenRCT2::Ui::Windows ViewportInteractionItem::footpath, ViewportInteractionItem::pathAddition, ViewportInteractionItem::parkEntrance, ViewportInteractionItem::wall, ViewportInteractionItem::largeScenery, ViewportInteractionItem::banner); + static constexpr WidgetIndex kDisabledWidgetsDefault[] = { + WIDX_BUTTON_MOVE_UP, WIDX_BUTTON_MOVE_DOWN, WIDX_BUTTON_REMOVE, WIDX_BUTTON_ROTATE, WIDX_BUTTON_COPY, + }; + static constexpr WidgetIndex kDisabledWidgetsLargeScenery[] = { WIDX_BUTTON_ROTATE }; + // clang-format off - static constexpr std::initializer_list kDisabledWidgetsByPage[] = { - { WIDX_BUTTON_MOVE_UP, WIDX_BUTTON_MOVE_DOWN, WIDX_BUTTON_REMOVE, WIDX_BUTTON_ROTATE, WIDX_BUTTON_COPY }, + static constexpr std::span kDisabledWidgetsByPage[] = { + kDisabledWidgetsDefault, {}, {}, {}, {}, {}, {}, - { WIDX_BUTTON_ROTATE }, + kDisabledWidgetsLargeScenery, {}, }; // clang-format on