[quake3-commits] r2389 - trunk/code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Dec 16 14:20:09 EST 2012


Author: ztm
Date: 2012-12-16 14:20:08 -0500 (Sun, 16 Dec 2012)
New Revision: 2389

Modified:
   trunk/code/client/cl_main.c
Log:
Save all arguments from connect for reconnect command.
Remove unnecessary localhost check from reconnect command.

Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2012-12-16 02:58:47 UTC (rev 2388)
+++ trunk/code/client/cl_main.c	2012-12-16 19:20:08 UTC (rev 2389)
@@ -127,7 +127,7 @@
 clientStatic_t		cls;
 vm_t				*cgvm;
 
-char				cl_reconnectServername[MAX_OSPATH];
+char				cl_reconnectArgs[MAX_OSPATH];
 char				cl_oldGame[MAX_QPATH];
 qboolean			cl_oldGameSet;
 
@@ -1689,14 +1689,10 @@
 ================
 */
 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 ) );
 }
 
 /*
@@ -1730,6 +1726,9 @@
 		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
@@ -1752,7 +1751,6 @@
 	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");



More information about the quake3-commits mailing list