]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - netconn.c
client: Add SV_Shutdown hook and remove all direct calls in non-server code. Lock...
[xonotic/darkplaces.git] / netconn.c
index 32fb1f35000229956fddc63b45550838526cc524..af1aae28eab4c3b8e15297ed96206ef3473f894d 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -1527,13 +1527,7 @@ static void NetConn_ConnectionEstablished(lhnetsocket_t *mysocket, lhnetaddress_
 #ifdef CONFIG_MENU
        M_Update_Return_Reason("");
 #endif
-       // if we're connecting to a remote server, shut down any local server
-       if (LHNETADDRESS_GetAddressType(peeraddress) != LHNETADDRESSTYPE_LOOP && sv.active)
-       {
-               SV_LockThreadMutex();
-               SV_Shutdown ();
-               SV_UnlockThreadMutex();
-       }
+       // Disconnect from the current server or stop demo playback
        if(cls.state == ca_connected || cls.demoplayback)
                CL_Disconnect();
        // allocate a net connection to keep track of things
@@ -2497,9 +2491,6 @@ void NetConn_ClientFrame(void)
        {
                Con_Print("Connection timed out\n");
                CL_Disconnect();
-               SV_LockThreadMutex();
-               SV_Shutdown ();
-               SV_UnlockThreadMutex();
        }
 }