Iterate over windows backwards to close last window; fixes #932

This commit is contained in:
Adrian Wielgosik 2015-03-19 22:35:33 +01:00
parent cd16af0f60
commit 3a6fcf790c
1 changed files with 1 additions and 1 deletions

View File

@ -594,7 +594,7 @@ void window_close_top()
if (RCT2_GLOBAL(0x0141F570, uint8) != 1)
return;
for (w = g_window_list; w < RCT2_LAST_WINDOW; w++) {
for (w = RCT2_NEW_WINDOW - 1; w >= g_window_list; w--) {
if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT))) {
window_close(w);
return;