]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
Merge branch 'master' into Mario/wrath-darkplaces_extra
[xonotic/darkplaces.git] / sv_main.c
index 5a469a5fc3b15fe2bb4d58db49406624ab899f72..ea951b5b4bd2c092e53bf5d8de9d90365c58b4b4 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -686,6 +686,7 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_writepicture_quality);
 
        SV_InitOperatorCommands();
+       host.hook.SV_Shutdown = SV_Shutdown;
 
        sv_mempool = Mem_AllocPool("server", 0, NULL);
 
@@ -1765,6 +1766,7 @@ void SV_SpawnServer (const char *map)
                Sys_MakeProcessNice();
        else
        {
+               SCR_SetLoadingSplash(NULL); // clear splash
                SCR_BeginLoadingPlaque(false);
                S_StopAllSounds();
        }
@@ -2058,10 +2060,12 @@ void SV_Shutdown(void)
        prvm_prog_t *prog = SVVM_prog;
        int i;
 
-       Con_DPrintf("SV_Shutdown\n");
+       SV_LockThreadMutex();
 
        if (!sv.active)
-               return;
+               goto end;
+
+       Con_DPrintf("SV_Shutdown\n");
 
        NetConn_Heartbeat(2);
        NetConn_Heartbeat(2);
@@ -2090,8 +2094,8 @@ void SV_Shutdown(void)
 //
        memset(&sv, 0, sizeof(sv));
        memset(svs.clients, 0, svs.maxclients*sizeof(client_t));
-
-       cl.islocalgame = false;
+end:
+       SV_UnlockThreadMutex();
 }
 
 /////////////////////////////////////////////////////