mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 08:14:38 +01:00
Fix #5893: Invalidate widget only if it's visible
Remove the widget_invalidate() call after changing a guest's guest_heading_to_ride_id, because that call fails a debug assertion if the guest window is open and the currently active tab is not the "overview" tab. In Release builds (if assertion is disabled), widget_invalidate() might access the widgets array out of bounds. Instead, introduce a new flag PEEP_INVALIDATE_PEEP_ACTION for window_invalidate_flags in the peep struct and set that flag. The guest window update function then makes sure to invalidate the label if the flag is set. The flag could be used in other places to reduce libopenrct2 dependency on window_*() calls (see #6808), but this commit only cares about cases where the assertion would fail.
This commit is contained in:
@@ -489,7 +489,6 @@ enum
|
||||
#define WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON 25
|
||||
#define WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON 30
|
||||
#define WC_PEEP__WIDX_PATROL 11
|
||||
#define WC_PEEP__WIDX_ACTION_LBL 12
|
||||
#define WC_PEEP__WIDX_PICKUP 13
|
||||
#define WC_TRACK_DESIGN_LIST__WIDX_ROTATE 8
|
||||
#define WC_TRACK_DESIGN_PLACE__WIDX_ROTATE 3
|
||||
|
||||
Reference in New Issue
Block a user