Skip to content

Commit

Permalink
Add $demo token to \video and \video-pipe to use the demo filename
Browse files Browse the repository at this point in the history
Does not follow demo sub folders.
  • Loading branch information
ensiform committed Nov 23, 2023
1 parent 541a376 commit eb85800
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4066,8 +4066,16 @@ static void CL_Video_f( void )

if ( Cmd_Argc() == 2 )
{
const char *arg = Cmd_Argv( 1 );
// explicit filename
Com_sprintf( filename, sizeof( filename ), "videos/%s", Cmd_Argv( 1 ) );
if ( !Q_stricmp( arg, "$demo") ) {
char demoName[ MAX_OSPATH ];
COM_StripExtension( clc.demoName, demoName, sizeof( clc.demoName ) );
Com_sprintf( filename, sizeof( filename ), "videos/%s", demoName );
}
else {
Com_sprintf( filename, sizeof( filename ), "videos/%s", arg );
}

// override video file extension
if ( pipe )
Expand Down

0 comments on commit eb85800

Please sign in to comment.