From: Cloudwalk Date: Thu, 22 Jul 2021 23:13:20 +0000 (-0400) Subject: sv_save: Call CL_Disconnect and ToggleMenu via hook X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bfd441930916e7a29200ea42d5d8edfcc2baa806;p=xonotic%2Fdarkplaces.git sv_save: Call CL_Disconnect and ToggleMenu via hook --- diff --git a/sv_save.c b/sv_save.c index ea5ab704..b90f7487 100644 --- a/sv_save.c +++ b/sv_save.c @@ -270,16 +270,11 @@ void SV_Loadgame_f(cmd_state_t *cmd) Con_Printf("Loading game from %s...\n", filename); - // stop playing demos - if (cls.demoplayback) - CL_Disconnect(); - -#ifdef CONFIG_MENU - // remove menu - if (key_dest == key_menu || key_dest == key_menu_grabbed) - MR_ToggleMenu(0); -#endif - key_dest = key_game; + if(host.hook.Disconnect) + host.hook.Disconnect(false, NULL); + + if(host.hook.ToggleMenu) + host.hook.ToggleMenu(); cls.demonum = -1; // stop demo loop in case this fails