Skip to content

Commit

Permalink
level: move main menu music option check to initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
walkawayy committed Sep 26, 2024
1 parent 614c18e commit 60f033a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/game/level.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,12 +1152,14 @@ bool Level_Initialise(int32_t level_num)
Music_SetVolume(g_Config.music_volume);
Sound_ResetEffects();

Viewport_SetFOV(Viewport_GetUserFOV());

if (g_GameFlow.levels[level_num].music) {
const bool disable_music = level_num == g_GameFlow.title_level_num
&& !g_Config.enable_music_in_menu;
if (g_GameFlow.levels[level_num].music && !disable_music) {
Music_PlayLooped(g_GameFlow.levels[level_num].music);
}

Viewport_SetFOV(Viewport_GetUserFOV());

g_InvItemPuzzle1.string = g_GameFlow.levels[level_num].puzzle1;
g_InvItemPuzzle2.string = g_GameFlow.levels[level_num].puzzle2;
g_InvItemPuzzle3.string = g_GameFlow.levels[level_num].puzzle3;
Expand Down
5 changes: 0 additions & 5 deletions src/game/music.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ bool Music_PlayLooped(MUSIC_TRACK_ID track)
return false;
}

if (g_CurrentLevel == g_GameFlow.title_level_num
&& !g_Config.enable_music_in_menu) {
return false;
}

M_StopActiveStream();

char *file_path = M_GetTrackFileName(track);
Expand Down

0 comments on commit 60f033a

Please sign in to comment.