]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
host: Shutdown client-only subsystems in CL_Shutdown.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 Jul 2020 02:44:18 +0000 (02:44 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 15 Jul 2020 02:44:18 +0000 (02:44 +0000)
This fixes an issue where darkplaces_history.txt was being generated on
dedicated servers but wasn't actually being used.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12812 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
host.c

index 3424e67c14bc663f1eb7a4f169f430c5bbebb9f3..7dc196eb47cdbc9abb275235197f82b3d7ed9233 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -2705,11 +2705,34 @@ CL_Shutdown
 */
 void CL_Shutdown (void)
 {
+       // be quiet while shutting down
+       S_StopAllSounds();
+       
+       // disconnect client from server if active
+       CL_Disconnect();
+       
+       CL_Video_Shutdown();
+
+#ifdef CONFIG_MENU
+       // Shutdown menu
+       if(MR_Shutdown)
+               MR_Shutdown();
+#endif
+
+       CDAudio_Shutdown ();
+       S_Terminate ();
+       
+       R_Modules_Shutdown();
+       VID_Shutdown();
+
        CL_Screen_Shutdown();
        CL_Particles_Shutdown();
        CL_Parse_Shutdown();
        CL_MeshEntities_Shutdown();
 
+       Key_Shutdown();
+       S_Shutdown();
+
        Mem_FreePool (&cls.permanentmempool);
        Mem_FreePool (&cls.levelmempool);
 }
diff --git a/host.c b/host.c
index 53e27fb7d35a2076aac56c3f4fe4712b41be9d56..55bd6fec4ff47529add1f495178899c0bebfd4d2 100644 (file)
--- a/host.c
+++ b/host.c
@@ -1113,58 +1113,36 @@ void Host_Shutdown(void)
        }
        isdown = true;
 
-       // be quiet while shutting down
-       S_StopAllSounds();
+       if(cls.state != ca_dedicated)
+               CL_Shutdown();
 
        // end the server thread
        if (svs.threaded)
                SV_StopThread();
 
-       // disconnect client from server if active
-       CL_Disconnect();
-
        // shut down local server if active
        SV_LockThreadMutex();
        SV_Shutdown ();
        SV_UnlockThreadMutex();
 
-#ifdef CONFIG_MENU
-       // Shutdown menu
-       if(MR_Shutdown)
-               MR_Shutdown();
-#endif
-
        // AK shutdown PRVM
        // AK hmm, no PRVM_Shutdown(); yet
 
-       CL_Video_Shutdown();
-
        Host_SaveConfig();
 
-       CDAudio_Shutdown ();
-       S_Terminate ();
        Curl_Shutdown ();
        NetConn_Shutdown ();
 
-       if (cls.state != ca_dedicated)
-       {
-               R_Modules_Shutdown();
-               VID_Shutdown();
-       }
-
        SV_StopThread();
        TaskQueue_Shutdown();
        Thread_Shutdown();
        Cmd_Shutdown();
-       Key_Shutdown();
-       CL_Shutdown();
        Sys_Shutdown();
        Log_Close();
        Crypto_Shutdown();
 
        Host_UnlockSession();
 
-       S_Shutdown();
        Con_Shutdown();
        Memory_Shutdown();
 }