diff options
author | Zack Middleton <zturtleman@gmail.com> | 2012-12-15 23:33:02 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-12 21:26:42 +0000 |
commit | c7799bc0ae45e6d40145d7e277e6bcfdca338233 (patch) | |
tree | bb5054e4ae88b23376677c50036cd29f7db09acd | |
parent | 91ae99ca4e1de95b54d9d3756f1c85a0abad4576 (diff) |
Fix reconnect command to work after leaving server. (#5794)
-rw-r--r-- | src/client/cl_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c index a9574d79..e2cd7ddd 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -127,6 +127,7 @@ clientConnection_t clc; clientStatic_t cls; vm_t *cgvm; +char cl_reconnectServername[MAX_OSPATH]; char cl_oldGame[MAX_QPATH]; qboolean cl_oldGameSet; @@ -1610,12 +1611,14 @@ CL_Reconnect_f ================ */ void CL_Reconnect_f( void ) { - if ( !strlen( clc.servername ) || !strcmp( clc.servername, "localhost" ) ) { + if ( !strlen( cl_reconnectServername ) ) + return; + if ( !strcmp( cl_reconnectServername, "localhost" ) ) { Com_Printf( "Can't reconnect to localhost.\n" ); return; } Cvar_Set("ui_singlePlayerActive", "0"); - Cbuf_AddText( va("connect %s\n", clc.servername ) ); + Cbuf_AddText( va("connect %s\n", cl_reconnectServername ) ); } /* @@ -1671,6 +1674,7 @@ void CL_Connect_f( void ) { Con_Close(); Q_strncpyz( clc.servername, server, sizeof(clc.servername) ); + Q_strncpyz( cl_reconnectServername, server, sizeof( cl_reconnectServername ) ); if (!NET_StringToAdr(clc.servername, &clc.serverAddress, family) ) { Com_Printf ("Bad server address\n"); |