Fix #26754: Guard stale hover widget index when switching window pages (#27086)

This commit is contained in:
Sjoerd de Bruin authored and GitHub committed 2026-09-07 17:51:20 -03:00
1 parent c3a2fe508f
commit b8a5e2431c
2 files changed
+6

No files matched your search

+1
View File
@@ -1,6 +1,7 @@
0.5.6 (in development)
------------------------------------------------------------------------
- Fix: [#24457] Yellow is always rendered as third remap in Ride window.
- Fix: [#26754] Switching window tabs by touch could crash the game on some Linux builds.
- Fix: [#27052] Unnamed rides in RCT2 base and Wacky Worlds scenarios have hardcoded English names.
0.5.5 (2026-09-06)
+5
View File
@@ -1024,6 +1024,11 @@ namespace OpenRCT2
if (w != nullptr)
{
w->onPrepareDraw();
// Switching a window to another page can leave the remembered index out of range.
if (static_cast<size_t>(gHoverWidget.widgetIndex) >= w->widgets.size())
return;
if (w->widgets[gHoverWidget.widgetIndex].type == WidgetType::flatBtn
|| w->widgets[gHoverWidget.widgetIndex].type == WidgetType::hiddenButton)
{