View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003024 | FSSCP | sound | public | 2014-03-24 18:12 | 2014-03-26 01:53 |
Reporter | Yarn | Assigned To | Yarn | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | x64 | OS | Windows 7 | ||
Product Version | 3.7.1 | ||||
Summary | 0003024: [patch] Prevent debriefing music from switching to an invalid track | ||||
Description | Goober asked me to post this here. Currently, if a mission specifies debriefing tracks, the game tries to use those for the debriefing, even if they don't exist in the music tables, resulting in silence. The attached patch fixes this by assigning debriefing tracks only if 1) they exist in the music tables and 2) the music files themselves exist (although the latter is not required in FRED). (For reference, retail FS2 switches the first briefing track, not silence, in this case.) | ||||
Tags | No tags attached. | ||||
|
DebriefingFix.patch (1,434 bytes)
Index: code/mission/missionparse.cpp =================================================================== --- code/mission/missionparse.cpp (revision 10507) +++ code/mission/missionparse.cpp (working copy) @@ -1117,7 +1117,10 @@ if (optional_string("$Debriefing Success Music:")) { stuff_string(temp, F_NAME, NAME_LENGTH); - event_music_set_score(SCORE_DEBRIEF_SUCCESS, temp); + index = event_music_get_spooled_music_index(temp); + if ((index >= 0) && ((Spooled_music[index].flags & SMF_VALID) || Fred_running)) { + event_music_set_score(SCORE_DEBRIEF_SUCCESS, temp); + } } // not old, just added since it makes sense @@ -1124,7 +1127,10 @@ if (optional_string("$Debriefing Average Music:")) { stuff_string(temp, F_NAME, NAME_LENGTH); - event_music_set_score(SCORE_DEBRIEF_AVERAGE, temp); + index = event_music_get_spooled_music_index(temp); + if ((index >= 0) && ((Spooled_music[index].flags & SMF_VALID) || Fred_running)) { + event_music_set_score(SCORE_DEBRIEF_AVERAGE, temp); + } } // old stuff @@ -1131,7 +1137,10 @@ if (optional_string("$Debriefing Fail Music:")) { stuff_string(temp, F_NAME, NAME_LENGTH); - event_music_set_score(SCORE_DEBRIEF_FAIL, temp); + index = event_music_get_spooled_music_index(temp); + if ((index >= 0) && ((Spooled_music[index].flags & SMF_VALID) || Fred_running)) { + event_music_set_score(SCORE_DEBRIEF_FAIL, temp); + } } // new stuff |
|
Fix committed to trunk@10531. |
|
Patch reviewed by me and tested by Yarn. Crediting Yarn for spotting the bug as well as fixing it. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-03-24 18:12 | Yarn | New Issue | |
2014-03-24 18:12 | Yarn | File Added: DebriefingFix.patch | |
2014-03-26 01:53 | Goober5000 | Changeset attached | => fs2open trunk r10531 |
2014-03-26 01:53 | Goober5000 | Note Added: 0015686 | |
2014-03-26 01:53 | Goober5000 | Status | new => resolved |
2014-03-26 01:53 | Goober5000 | Resolution | open => fixed |
2014-03-26 01:53 | Goober5000 | Note Added: 0015687 | |
2014-03-26 01:53 | Goober5000 | Assigned To | => Yarn |