Skip to content

Commit

Permalink
* (bug 3018) Should not reset CVAR_CHEAT cvars when loading cgame/ui …
Browse files Browse the repository at this point in the history
…if they

             are being loaded to play a demo.  This restores the normal
             "timedemo" cvar behaviour.
* (bug 3054) The "demo" command works properly now when connected to
             the local server
  • Loading branch information
tjdub committed Apr 5, 2007
1 parent de36486 commit b5bf128
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/client/cl_cgame.c
Expand Up @@ -747,7 +747,7 @@ void CL_InitCGame( void ) {
VM_Call( cgvm, CG_INIT, clc.serverMessageSequence, clc.lastExecutedServerCommand, clc.clientNum );

// reset any CVAR_CHEAT cvars registered by cgame
if ( !cl_connectedToCheatServer )
if ( !clc.demoplaying && !cl_connectedToCheatServer )
Cvar_SetCheatState();

// we will send a usercmd this frame, which
Expand Down
3 changes: 2 additions & 1 deletion code/client/cl_main.c
Expand Up @@ -508,7 +508,8 @@ void CL_PlayDemo_f( void ) {
}

// make sure a local server is killed
Cvar_Set( "sv_killserver", "1" );
// 2 means don't force disconnect of local client
Cvar_Set( "sv_killserver", "2" );

CL_Disconnect( qtrue );

Expand Down
2 changes: 1 addition & 1 deletion code/client/cl_ui.c
Expand Up @@ -1173,7 +1173,7 @@ void CL_InitUI( void ) {
}

// reset any CVAR_CHEAT cvars registered by ui
if ( !cl_connectedToCheatServer )
if ( !clc.demoplaying && !cl_connectedToCheatServer )
Cvar_SetCheatState();
}

Expand Down
3 changes: 2 additions & 1 deletion code/server/sv_init.c
Expand Up @@ -747,6 +747,7 @@ void SV_Shutdown( char *finalmsg ) {
Com_Printf( "---------------------------\n" );

// disconnect any local clients
CL_Disconnect( qfalse );
if( sv_killserver->integer != 2 )
CL_Disconnect( qfalse );
}

0 comments on commit b5bf128

Please sign in to comment.