diff options
author | Zack Middleton <zturtleman@gmail.com> | 2012-12-16 19:20:08 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-12 21:26:43 +0000 |
commit | f602b02641142bef5225b9f94530a07d58dcfb19 (patch) | |
tree | 667cf0f76a4639584d01497db06a025067e470c5 | |
parent | a38a154971e58fd592c5f04b5ed3d36ef9e22de8 (diff) |
Save all arguments from connect for reconnect command. Remove unnecessary localhost check from reconnect command.
-rw-r--r-- | src/client/cl_main.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c index e2cd7ddd..3244bc7c 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -127,7 +127,7 @@ clientConnection_t clc; clientStatic_t cls; vm_t *cgvm; -char cl_reconnectServername[MAX_OSPATH]; +char cl_reconnectArgs[MAX_OSPATH]; char cl_oldGame[MAX_QPATH]; qboolean cl_oldGameSet; @@ -1611,14 +1611,10 @@ CL_Reconnect_f ================ */ void CL_Reconnect_f( void ) { - if ( !strlen( cl_reconnectServername ) ) + if ( !strlen( cl_reconnectArgs ) ) 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", cl_reconnectServername ) ); + Cbuf_AddText( va("connect %s\n", cl_reconnectArgs ) ); } /* @@ -1652,6 +1648,9 @@ void CL_Connect_f( void ) { server = Cmd_Argv(2); } + // save arguments for reconnect + Q_strncpyz( cl_reconnectArgs, Cmd_Args(), sizeof( cl_reconnectArgs ) ); + Cvar_Set("ui_singlePlayerActive", "0"); // fire a message off to the motd server @@ -1674,7 +1673,6 @@ 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"); |