Add assert for widget index invalidation

This commit is contained in:
Michał Janiszewski 2016-08-21 15:20:30 +01:00 committed by Ted John
parent 112b70c15b
commit 634fc12875
1 changed files with 6 additions and 0 deletions

View File

@ -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;