Skip to content

Commit

Permalink
All: Fix loading map from command line in SP
Browse files Browse the repository at this point in the history
map command unloads the UI VM and then cinematic command is processed.
Video is not displayed because UI VM is not loaded and input causes
error that UI VM is NULL. I changed it to use Quake 3 behavior of only
playing intro if there are no command line arguments. This does not
affect MP as there is no logo or intro video present.

Fixes running "iowolfsp.x86_64 +spmap escape1".
  • Loading branch information
zturtleman committed Nov 29, 2018
1 parent ef829a9 commit 7ae64d4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
23 changes: 11 additions & 12 deletions MP/code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2896,6 +2896,17 @@ void Com_Init( char *commandLine ) {
// add + commands from command line
if ( !Com_AddStartupCommands() ) {
// if the user didn't give any commands, run default action
if ( !com_dedicated->integer ) {
#ifdef CINEMATICS_LOGO
Cbuf_AddText( "cinematic " CINEMATICS_LOGO "\n" );
#endif
#ifdef CINEMATICS_INTRO
if ( !com_introPlayed->integer ) {
Cvar_Set( com_introPlayed->name, "1" );
Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
}
#endif
}
}

// start in full screen ui mode
Expand All @@ -2910,18 +2921,6 @@ void Com_Init( char *commandLine ) {
}
Cvar_Set( "com_recommendedSet", "1" );

if ( !com_dedicated->integer ) {
#ifdef CINEMATICS_LOGO
Cbuf_AddText( "cinematic " CINEMATICS_LOGO "\n" );
#endif
#ifdef CINEMATICS_INTRO
if ( !com_introPlayed->integer ) {
Cvar_Set( com_introPlayed->name, "1" );
Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
}
#endif
}

com_fullyInitialized = qtrue;

// always set the cvar, but only print the info if it makes sense.
Expand Down
25 changes: 12 additions & 13 deletions SP/code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,18 @@ void Com_Init( char *commandLine ) {
// add + commands from command line
if ( !Com_AddStartupCommands() ) {
// if the user didn't give any commands, run default action
if ( !com_dedicated->integer ) {
#ifdef CINEMATICS_LOGO
//Cbuf_AddText ("cinematic " CINEMATICS_LOGO "\n");
#endif
#ifdef CINEMATICS_INTRO
if ( !com_introPlayed->integer ) {
//Cvar_Set( com_introPlayed->name, "1" ); //----(SA) force this to get played every time (but leave cvar for override)
Cbuf_AddText( "cinematic " CINEMATICS_INTRO " 3\n" );
//Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
}
#endif
}
}

// start in full screen ui mode
Expand All @@ -2456,19 +2468,6 @@ void Com_Init( char *commandLine ) {
Cvar_Set( "com_recommendedSet", "1" );
}

if ( !com_dedicated->integer ) {
#ifdef CINEMATICS_LOGO
//Cbuf_AddText ("cinematic " CINEMATICS_LOGO "\n");
#endif
#ifdef CINEMATICS_INTRO
if ( !com_introPlayed->integer ) {
//Cvar_Set( com_introPlayed->name, "1" ); //----(SA) force this to get played every time (but leave cvar for override)
Cbuf_AddText( "cinematic " CINEMATICS_INTRO " 3\n" );
//Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
}
#endif
}

com_fullyInitialized = qtrue;

// always set the cvar, but only print the info if it makes sense.
Expand Down

0 comments on commit 7ae64d4

Please sign in to comment.