diff options
author | Andrey Nazarov <skuller@skuller.net> | 2009-04-22 23:40:03 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2009-04-22 23:40:03 +0000 |
commit | 275f310df767a57b8cf409acdcbd14c63cb90df9 (patch) | |
tree | 3b59e2751c32b2f15fcfabb1af8b03e702cd5230 /source/cl_main.c | |
parent | 385ccd0e9a518933019a8c6f1fecad2ae660b766 (diff) |
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.
Diffstat (limited to 'source/cl_main.c')
-rw-r--r-- | source/cl_main.c | 19 |
1 files changed, 12 insertions, 7 deletions
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 |