]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
sv_save: Call CL_Disconnect and ToggleMenu via hook
authorCloudwalk <cloudwalk009@gmail.com>
Thu, 22 Jul 2021 23:13:20 +0000 (19:13 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Thu, 22 Jul 2021 23:13:20 +0000 (19:13 -0400)
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