Skip to content

Commit

Permalink
Only play logo/intro if their filenames have been defined in q_shared.h
Browse files Browse the repository at this point in the history
  • Loading branch information
thiloschulz committed Jun 16, 2016
1 parent 9f6c494 commit bb7ad55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/qcommon/common.c
Expand Up @@ -72,7 +72,9 @@ cvar_t *com_showtrace;
cvar_t *com_version;
cvar_t *com_blood;
cvar_t *com_buildScript; // for automated data building scripts
#ifdef CINEMATICS_INTRO
cvar_t *com_introPlayed;
#endif
cvar_t *cl_paused;
cvar_t *sv_paused;
cvar_t *cl_packetdelay;
Expand Down Expand Up @@ -2805,11 +2807,15 @@ void Com_Init( char *commandLine ) {
if ( !Com_AddStartupCommands() ) {
// if the user didn't give any commands, run default action
if ( !com_dedicated->integer ) {
#ifdef CINEMATICS_LOGO

This comment has been minimized.

Copy link
@ensiform

ensiform Jun 18, 2016

Couldn't you simplify this to just 1 #ifdef block ?

This comment has been minimized.

Copy link
@thiloschulz

thiloschulz Jun 18, 2016

Author Member

strcmp ("CINEMATICS_INTRO", "CINEMATICS_LOGO") != 0

This comment has been minimized.

Copy link
@ensiform

ensiform Jun 18, 2016

My bad misread the difference.

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
}
}

Expand Down
2 changes: 2 additions & 0 deletions code/ui/ui_main.c
Expand Up @@ -3222,7 +3222,9 @@ static void UI_RunMenuScript(char **args) {
trap_Cmd_ExecuteText( EXEC_APPEND, "exec default.cfg\n");
trap_Cmd_ExecuteText( EXEC_APPEND, "cvar_restart\n");
Controls_SetDefaults();
#ifdef CINEMATICS_INTRO
trap_Cvar_Set("com_introPlayed", "1" );
#endif
trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" );
} else if (Q_stricmp(name, "getCDKey") == 0) {
char out[17];
Expand Down

0 comments on commit bb7ad55

Please sign in to comment.