Avoid spinning in multiplayer when the game window is hidden
When the host exits the game, guests switch the game window to be non-visible, and raise a dialog box stating `Host has left the game!`. Prior to this change, the guests would then busy loop until the dialog was dismissed. With this change, the game will sleep for each idle event, minimizing CPU use during the period waiting for the player to acknowledge the dialog box.
This commit is contained in:
parent
45362ac37b
commit
ad46235b67
|
@ -1616,7 +1616,7 @@ window_event_result newmenu::event_handler(const d_event &event)
|
|||
case EVENT_KEY_COMMAND:
|
||||
return newmenu_key_command(event, this);
|
||||
case EVENT_IDLE:
|
||||
if (!(Game_mode & GM_MULTI && Game_wind))
|
||||
if (!(Game_mode & GM_MULTI) || !Game_wind || !Game_wind->is_visible())
|
||||
timer_delay2(CGameArg.SysMaxFPS);
|
||||
break;
|
||||
case EVENT_WINDOW_DRAW:
|
||||
|
|
Loading…
Reference in a new issue