From 693c422cd452e607f8b91a005ce7a3a097f79928 Mon Sep 17 00:00:00 2001 From: Andrew <5436387+fidwell@users.noreply.github.com> Date: Fri, 22 Mar 2024 06:20:48 -0400 Subject: [PATCH] Prevent TI hotkey from setting wall slope for non-slopeable objects (#21635) --- distribution/changelog.txt | 1 + src/openrct2-ui/input/Shortcuts.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9b8a275719..1541297003 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. +- Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. - Fix: [#21641] Crash when creating track iterator from an invalid tile element. 0.4.9 (2024-03-02) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index d589537f58..983f6746df 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -527,6 +528,12 @@ static void ShortcutToggleWallSlope() return; } + // Ensure a wall can be built on a slope + if (tileElement->AsWall()->GetEntry()->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE) + { + return; + } + int32_t currSlopeValue = tileElement->AsWall()->GetSlope(); int32_t newSlopeValue = (currSlopeValue + 1) % 3;