Skip to content

Commit

Permalink
- make the title music only play once, unless a real demo is successf…
Browse files Browse the repository at this point in the history
…ully played.
  • Loading branch information
coelckers committed May 17, 2021
1 parent aaf8323 commit e47671c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/d_main.cpp
Expand Up @@ -315,6 +315,7 @@ FStartupInfo GameStartupInfo;
FString lastIWAD;
int restart = 0;
bool AppActive = true;
bool playedtitlemusic;

cycle_t FrameCycles;

Expand Down Expand Up @@ -1573,7 +1574,8 @@ void D_DoAdvanceDemo (void)
gamestate = GS_DEMOSCREEN;
pagename = gameinfo.TitlePage;
pagetic = (int)(gameinfo.titleTime * TICRATE);
S_ChangeMusic (gameinfo.titleMusic, gameinfo.titleOrder, false);
if (!playedtitlemusic) S_ChangeMusic (gameinfo.titleMusic, gameinfo.titleOrder, false);
playedtitlemusic = true;
demosequence = 3;
pagecount = 0;
C_HideConsole ();
Expand Down
4 changes: 3 additions & 1 deletion src/g_game.cpp
Expand Up @@ -138,6 +138,7 @@ CUSTOM_CVAR (Int, displaynametags, 0, CVAR_ARCHIVE)

CVAR(Int, nametagcolor, CR_GOLD, CVAR_ARCHIVE)

extern bool playedtitlemusic;

gameaction_t gameaction;
gamestate_t gamestate = GS_STARTUP;
Expand Down Expand Up @@ -1166,7 +1167,7 @@ void G_Ticker ()
case ga_loadgameplaydemo:
G_DoLoadGame ();
// fallthrough
case ga_playdemo:
case ga_playdemo:
G_DoPlayDemo ();
break;
case ga_completed:
Expand Down Expand Up @@ -2934,6 +2935,7 @@ void G_DoPlayDemo (void)

usergame = false;
demoplayback = true;
playedtitlemusic = false;
}
}

Expand Down

0 comments on commit e47671c

Please sign in to comment.