summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/window.c b/window.c
index 2b9d10910..e9ef7f7b7 100644
--- a/window.c
+++ b/window.c
@@ -66,10 +66,9 @@ void CDECL SetWindowWidgetsLoweredState(Window *w, bool lowered_stat, int widget
void RaiseWindowButtons(Window *w)
{
- const Widget *wi = w->widget;
- uint i = 0;
+ uint i;
- for (i = 0; wi->type != WWT_LAST; i++, wi++) {
+ for (i = 0; i < w->widget_count; i++) {
if (IsWindowWidgetLowered(w, i)) {
RaiseWindowWidget(w, i);
InvalidateWidget(w, i);