From 3b63c54a24cc5a146f294e7d1db85c94e948260f Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 11 Nov 2009 10:51:33 +0000 Subject: [PATCH] * Fix demo playback being broken, not entirely sure by what or when --- code/client/cl_main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 78922958..8695d579 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -929,7 +929,7 @@ void CL_PlayDemo_f( void ) { char retry[MAX_OSPATH]; if (Cmd_Argc() != 2) { - Com_Printf ("playdemo \n"); + Com_Printf ("demo \n"); return; } @@ -937,14 +937,17 @@ void CL_PlayDemo_f( void ) { // 2 means don't force disconnect of local client Cvar_Set( "sv_killserver", "2" ); - CL_Disconnect( qtrue ); - // open the demo file arg = Cmd_Argv(1); + CL_Disconnect( qtrue ); + // check for an extension .dm_?? (?? is protocol) ext_test = arg + strlen(arg) - 6; - if ((strlen(arg) > 6) && (ext_test[0] == '.') && ((ext_test[1] == 'd') || (ext_test[1] == 'D')) && ((ext_test[2] == 'm') || (ext_test[2] == 'M')) && (ext_test[3] == '_')) + if ((strlen(arg) > 6) && (ext_test[0] == '.') && + ((ext_test[1] == 'd') || (ext_test[1] == 'D')) && + ((ext_test[2] == 'm') || (ext_test[2] == 'M')) && + (ext_test[3] == '_')) { protocol = atoi(ext_test+4); i=0;