2018-12-18 18:13 EST


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0003024FSSCPsoundpublic2014-03-25 21:53
ReporterYarn 
Assigned ToYarn 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformx64OSWindows 7OS Version
Product Version3.7.1 
Target VersionFixed in Version 
Summary0003024: [patch] Prevent debriefing music from switching to an invalid track
DescriptionGoober 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.)
TagsNo tags attached.
Attached Files
  • patch file icon DebriefingFix.patch (1,434 bytes) 2014-03-24 14:12 -
    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
    
    patch file icon DebriefingFix.patch (1,434 bytes) 2014-03-24 14:12 +

-Relationships
+Relationships

-Notes

~0015686

Goober5000 (administrator)

Fix committed to trunk@10531.

~0015687

Goober5000 (administrator)

Patch reviewed by me and tested by Yarn. Crediting Yarn for spotting the bug as well as fixing it.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2014-03-24 14:12 Yarn New Issue
2014-03-24 14:12 Yarn File Added: DebriefingFix.patch
2014-03-25 21:53 Goober5000 Changeset attached => fs2open trunk r10531
2014-03-25 21:53 Goober5000 Note Added: 0015686
2014-03-25 21:53 Goober5000 Status new => resolved
2014-03-25 21:53 Goober5000 Resolution open => fixed
2014-03-25 21:53 Goober5000 Note Added: 0015687
2014-03-25 21:53 Goober5000 Assigned To => Yarn
+Issue History