mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add assert for widget index invalidation
This commit is contained in:
parent
112b70c15b
commit
634fc12875
|
@ -976,6 +976,12 @@ void widget_invalidate(rct_window *w, int widgetIndex)
|
|||
rct_widget* widget;
|
||||
|
||||
assert(w != NULL);
|
||||
#if DEBUG
|
||||
for (int i = 0; i <= widgetIndex; i++) {
|
||||
assert(w->widgets[i].type != WWT_LAST);
|
||||
}
|
||||
#endif
|
||||
|
||||
widget = &w->widgets[widgetIndex];
|
||||
if (widget->left == -2)
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue