From 6ed84ddabd7890c6d1b9ae92bb485869289fb446 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 18 Sep 2016 23:27:02 +0100 Subject: [PATCH] Fix #3936: 'Close all windows' shortcut leaves one window when top toolbar is hidden Close all windows was missing out the last window in the list. Normally this would be the toolbar which is why the bug only appears when toolbars are hidden. --- src/interface/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface/window.c b/src/interface/window.c index 75b71a49e5..21d0513633 100644 --- a/src/interface/window.c +++ b/src/interface/window.c @@ -827,7 +827,7 @@ void window_close_all() window_close_by_class(WC_DROPDOWN); - for (w = g_window_list; w < RCT2_LAST_WINDOW; w++){ + for (w = g_window_list; w <= RCT2_LAST_WINDOW; w++) { if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) { window_close(w); w = g_window_list; @@ -841,7 +841,7 @@ void window_close_all_except_class(rct_windowclass cls) window_close_by_class(WC_DROPDOWN); - for (w = g_window_list; w < RCT2_LAST_WINDOW; w++){ + for (w = g_window_list; w <= RCT2_LAST_WINDOW; w++){ if (w->classification != cls && !(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) { window_close(w); w = g_window_list;