Skip to content

Commit c745925

Browse files
Goober5000claude
andcommitted
fix mainhall music continuing to play during mission loop brief
When a player enters the mission loop screen from the main hall, there was no code to handle the stopping of main hall music and ambient sound. Add code to handle this specific case. Also fix `Loop_sound` not being initialized to -1 `in loop_brief_init()`, which caused an assert when closing the loop brief screen if no branch brief sound was defined for the mission. Fixes scp-fs2open#7330. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cc26887 commit c745925

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

code/missionui/missionloopbrief.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int Loop_brief_bitmap;
9494

9595
generic_anim Loop_anim;
9696

97-
int Loop_sound;
97+
int Loop_sound = -1;
9898

9999
// ---------------------------------------------------------------------------------------------------------------------------------------
100100
// MISSION LOOP BRIEF FUNCTIONS
@@ -127,6 +127,9 @@ void loop_brief_init()
127127
int idx;
128128
ui_button_info *b;
129129

130+
// init sound handle
131+
Loop_sound = -1;
132+
130133
// load the background bitmap
131134
Loop_brief_bitmap = bm_load(Loop_brief_fname[gr_screen.res]);
132135
Assert(Loop_brief_bitmap != -1);

freespace2/freespace.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6293,6 +6293,10 @@ void mouse_force_pos(int x, int y);
62936293
break;
62946294

62956295
case GS_STATE_LOOP_BRIEF:
6296+
if (old_state == GS_STATE_MAIN_MENU) {
6297+
main_hall_stop_music(true);
6298+
main_hall_stop_ambient();
6299+
}
62966300
loop_brief_init();
62976301
break;
62986302

0 commit comments

Comments
 (0)