Fixes an issue where a demo freezes in place if you try to connect while one is
running. This also has the side effect of eliminating a duplicate call to
CL_StopPlayback, which is called by both CL_EstablishConnection and
CL_Disconnect (which is itself called by NetConn_ConnectionEstablished).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12544
d7cf8633-e32d-0410-b094-
e92efae38249
#ifdef CONFIG_MENU
M_Update_Return_Reason("");
#endif
- cls.demonum = -1;
-
- // stop demo loop in case this fails
- if (cls.demoplayback)
- CL_StopPlayback();
// if downloads are running, cancel their finishing action
Curl_Clear_forthismap();
+ // Disconnect from the current server, or stop a running demo.
+ CL_Disconnect();
+
// make sure the client ports are open before attempting to connect
NetConn_UpdateSockets();
#ifdef CONFIG_MENU
M_Update_Return_Reason("");
#endif
- // the connection request succeeded, stop current connection and set up a new connection
- CL_Disconnect();
// if we're connecting to a remote server, shut down any local server
if (LHNETADDRESS_GetAddressType(peeraddress) != LHNETADDRESSTYPE_LOOP && sv.active)
{