sv_save: Call CL_Disconnect and ToggleMenu via hook
[xonotic/darkplaces.git] / sv_save.c
index ea5ab7046224e1e0083adba742eec3aeeeef3eb8..b90f748775029e8b2ff0b9640fdfef52bd768961 100644 (file)
--- 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