From fd3346b4b3a35f09bcca4eb485ee0a1e91889ddc Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 15 May 2023 20:57:17 +0200 Subject: [PATCH] Fix: items after the removed RCT1 theme have wrong index --- src/openrct2-ui/windows/Options.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 172f485e31..b1d019bb0b 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1397,6 +1397,14 @@ private: break; case WIDX_TITLE_MUSIC_DROPDOWN: { + // HACK: When RCT1 is not available, it's not in the dropdown, so indices higher than it should be incremented + const bool rct1MusicThemeIsAvailable = IsRCT1TitleMusicAvailable(); + for (size_t i = 0; i < std::size(TitleThemeOptions) && static_cast(i) <= dropdownIndex; i++) + { + if (TitleThemeOptions[i].Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable) + dropdownIndex++; + } + gConfigSound.TitleMusic = TitleThemeOptions[dropdownIndex].Kind; ConfigSaveDefault(); Invalidate();