Skip to content

Commit 7ae64d4

Browse files
committed
All: Fix loading map from command line in SP
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".
1 parent ef829a9 commit 7ae64d4

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

MP/code/qcommon/common.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,6 +2896,17 @@ void Com_Init( char *commandLine ) {
28962896
// add + commands from command line
28972897
if ( !Com_AddStartupCommands() ) {
28982898
// if the user didn't give any commands, run default action
2899+
if ( !com_dedicated->integer ) {
2900+
#ifdef CINEMATICS_LOGO
2901+
Cbuf_AddText( "cinematic " CINEMATICS_LOGO "\n" );
2902+
#endif
2903+
#ifdef CINEMATICS_INTRO
2904+
if ( !com_introPlayed->integer ) {
2905+
Cvar_Set( com_introPlayed->name, "1" );
2906+
Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
2907+
}
2908+
#endif
2909+
}
28992910
}
29002911

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

2913-
if ( !com_dedicated->integer ) {
2914-
#ifdef CINEMATICS_LOGO
2915-
Cbuf_AddText( "cinematic " CINEMATICS_LOGO "\n" );
2916-
#endif
2917-
#ifdef CINEMATICS_INTRO
2918-
if ( !com_introPlayed->integer ) {
2919-
Cvar_Set( com_introPlayed->name, "1" );
2920-
Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
2921-
}
2922-
#endif
2923-
}
2924-
29252924
com_fullyInitialized = qtrue;
29262925

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

SP/code/qcommon/common.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,6 +2444,18 @@ void Com_Init( char *commandLine ) {
24442444
// add + commands from command line
24452445
if ( !Com_AddStartupCommands() ) {
24462446
// if the user didn't give any commands, run default action
2447+
if ( !com_dedicated->integer ) {
2448+
#ifdef CINEMATICS_LOGO
2449+
//Cbuf_AddText ("cinematic " CINEMATICS_LOGO "\n");
2450+
#endif
2451+
#ifdef CINEMATICS_INTRO
2452+
if ( !com_introPlayed->integer ) {
2453+
//Cvar_Set( com_introPlayed->name, "1" ); //----(SA) force this to get played every time (but leave cvar for override)
2454+
Cbuf_AddText( "cinematic " CINEMATICS_INTRO " 3\n" );
2455+
//Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
2456+
}
2457+
#endif
2458+
}
24472459
}
24482460

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

2459-
if ( !com_dedicated->integer ) {
2460-
#ifdef CINEMATICS_LOGO
2461-
//Cbuf_AddText ("cinematic " CINEMATICS_LOGO "\n");
2462-
#endif
2463-
#ifdef CINEMATICS_INTRO
2464-
if ( !com_introPlayed->integer ) {
2465-
//Cvar_Set( com_introPlayed->name, "1" ); //----(SA) force this to get played every time (but leave cvar for override)
2466-
Cbuf_AddText( "cinematic " CINEMATICS_INTRO " 3\n" );
2467-
//Cvar_Set( "nextmap", "cinematic " CINEMATICS_INTRO );
2468-
}
2469-
#endif
2470-
}
2471-
24722471
com_fullyInitialized = qtrue;
24732472

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

0 commit comments

Comments
 (0)