Return window_event_result::deleted if Game_wind closed

Return window_event_result::deleted if Game_wind was closed somewhere in response to an event handled by game_handler, so in future the event code can use that instead of window_exists to avoid tripping up.
This commit is contained in:
Chris Taylor 2016-10-27 12:24:02 +08:00
parent 8b62870245
commit 2613545712

View file

@ -1307,12 +1307,15 @@ window_event_result game_handler(window *,const d_event &event, const unused_win
Game_wind = NULL;
event_toggle_focus(0);
key_toggle_repeat(1);
return window_event_result::ignored;
break;
default:
break;
}
return window_event_result::ignored;
// If we deleted the window, tell the event loop
return Game_wind ? window_event_result::ignored : window_event_result::deleted;
}
// Initialise game, actually runs in main event loop