git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12952
d7cf8633-e32d-0410-b094-
e92efae38249
*/
void CL_Disconnect(void)
{
- if (cls.state == ca_dedicated || cls.state != ca_connected || !cls.demoplayback)
+ if (cls.state == ca_dedicated)
return;
if (Sys_CheckParm("-profilegameonly"))
if (LHNETADDRESS_FromString(&cls.connect_address, address, 26000) && (cls.connect_mysocket = NetConn_ChooseClientSocketForAddress(&cls.connect_address)))
{
// Disconnect from the current server, or stop a running demo.
- CL_Disconnect();
cls.connect_trying = true;
cls.connect_remainingtries = 3;
cls.connect_nextsendtime = 0;
SV_Shutdown ();
SV_UnlockThreadMutex();
}
+ if(cls.state == ca_connected || cls.demoplayback)
+ CL_Disconnect();
// allocate a net connection to keep track of things
cls.netcon = NetConn_Open(mysocket, peeraddress);
crypto = &cls.netcon->crypto;