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;
|
rct_widget* widget;
|
||||||
|
|
||||||
assert(w != NULL);
|
assert(w != NULL);
|
||||||
|
#if DEBUG
|
||||||
|
for (int i = 0; i <= widgetIndex; i++) {
|
||||||
|
assert(w->widgets[i].type != WWT_LAST);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
widget = &w->widgets[widgetIndex];
|
widget = &w->widgets[widgetIndex];
|
||||||
if (widget->left == -2)
|
if (widget->left == -2)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue