From 275f310df767a57b8cf409acdcbd14c63cb90df9 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Wed, 22 Apr 2009 23:40:03 +0000 Subject: Don't execute ‘cl_beginmapcmd’, ‘cl_changemapcmd’ and ‘cl_disconnectcmd’ triggers when playing back demos. Fixed automatic restart of sound subsystem after cvar change not working randomly. Don't crash in CL_Disconnect() on dedicated server exit. Added ‘sv_redirect_address’ variable. Fixed ‘\r’ char not stripped properly from filename when processing ‘\include’ directive in AC config files. Made AC config parser compliant with reference format as defined by R1Q2 implementation. Updated documentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/cl_main.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'source/cl_main.c') diff --git a/source/cl_main.c b/source/cl_main.c index ed28ba0..cc04be8 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -610,7 +610,7 @@ This is also called on Com_Error, so it shouldn't cause any errors ===================== */ void CL_Disconnect( comErrorType_t type, const char *text ) { - if( cls.state > ca_disconnected ) { + if( cls.state > ca_disconnected && !cls.demo.playback ) { EXEC_TRIGGER( cl_disconnectcmd ); } @@ -975,7 +975,9 @@ static void CL_Changing_f( void ) { Com_Printf( "Changing map...\n" ); - EXEC_TRIGGER( cl_changemapcmd ); + if( !cls.demo.playback ) { + EXEC_TRIGGER( cl_changemapcmd ); + } SCR_BeginLoadingPlaque(); @@ -2340,7 +2342,6 @@ CL_LocalConnect */ void CL_LocalConnect( void ) { if ( FS_NeedRestart() ) { - cls.state = ca_challenging; CL_RestartFilesystem(); } } @@ -2908,11 +2909,11 @@ CL_Init ==================== */ void CL_Init( void ) { - if ( dedicated->integer ) { + if( dedicated->integer ) { return; // nothing running on the client } - if ( cl_running->integer ) { + if( cl_running->integer ) { return; } @@ -2982,13 +2983,17 @@ to run quit through here before the final handoff to the sys code. */ void CL_Shutdown( void ) { static qboolean isdown = qfalse; - - if ( isdown ) { + + if( isdown ) { Com_Printf( "CL_Shutdown: recursive shutdown\n" ); return; } isdown = qtrue; + if( !cl_running || !cl_running->integer ) { + return; + } + CL_Disconnect( ERR_SILENT, NULL ); #if USE_ZLIB -- cgit v1.2.3