From 5396368274ceff4bf3404ce2292917141bc35141 Mon Sep 17 00:00:00 2001 From: Basssiiie Date: Sat, 19 Nov 2022 12:29:01 +0100 Subject: [PATCH] [Plugin] Fix crash when reading widget property on window that has both static and tab content (#18620) --- distribution/changelog.txt | 1 + src/openrct2-ui/scripting/CustomWindow.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 1bd3ed6120..fb03f5d243 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -43,6 +43,7 @@ - Fix: [#18453] Slow walking guests don't get across level crossings in time. - Fix: [#18459] ‘Highlight path issues’ hides fences for paths with additions. - Fix: [#18606] JSON objects do not take priority over the DAT files they supersede. +- Fix: [#18620] [Plugin] Crash when reading widget properties from windows that have both static and tab widgets. 0.4.2 (2022-10-05) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 9878f08ea0..441c939796 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -365,7 +365,7 @@ namespace OpenRCT2::Ui::Windows auto tabWidgetIndex = widgetDescIndex - Desc.Widgets.size(); if (tabWidgetIndex < widgets.size()) { - return &widgets[widgetDescIndex]; + return &widgets[tabWidgetIndex]; } } }