Skip to content

Commit e3b24ea

Browse files
committed
check all possible extensions for audio files
When the code checks for the existence of an audio file, be sure to check all relevant extensions. This fixes #4495. Tested with both ST:R personas as well as the Vasudan persona.
1 parent 8c39bf5 commit e3b24ea

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

code/gamesnd/eventmusic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ void parse_soundtrack()
12941294
continue;
12951295

12961296
// check for file
1297-
if (!cf_exists_full(Soundtracks[strack_idx].patterns[i].fname, CF_TYPE_MUSIC))
1297+
if (!cf_exists_full_ext(Soundtracks[strack_idx].patterns[i].fname, CF_TYPE_MUSIC, NUM_AUDIO_EXT, audio_ext_list))
12981298
return;
12991299
}
13001300

code/mission/missionmessage.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "scripting/scripting.h"
3535
#include "ship/ship.h"
3636
#include "ship/subsysdamage.h"
37+
#include "sound/audiostr.h"
3738
#include "sound/fsspeech.h"
3839
#include "species_defs/species_defs.h"
3940
#include "utils/Random.h"
@@ -1735,7 +1736,7 @@ void message_queue_message( int message_num, int priority, int timing, const cha
17351736
if (message_filename_has_fs1_wingman_prefix(filename)) {
17361737
char converted[MAX_FILENAME_LEN];
17371738
message_filename_convert_to_command(converted, filename);
1738-
if (cf_exists_full(converted, CF_TYPE_VOICE_SPECIAL)) {
1739+
if (cf_exists_full_ext(converted, CF_TYPE_VOICE_SPECIAL, NUM_AUDIO_EXT, audio_ext_list)) {
17391740
convert_to_command = true;
17401741
}
17411742
}

code/missionui/missiondebrief.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ void debrief_choose_voice(char *voice_dest, size_t buf_size, char *voice_base, i
926926
if (snprintf(voice_dest, buf_size, NOX("%d_%s"), persona_index, voice_base) < static_cast<int>(buf_size))
927927
{
928928
// if it exists, we're done
929-
if (cf_exists_full(voice_dest, CF_TYPE_VOICE_DEBRIEFINGS))
929+
if (cf_exists_full_ext(voice_dest, CF_TYPE_VOICE_DEBRIEFINGS, NUM_AUDIO_EXT, audio_ext_list))
930930
return;
931931
}
932932

0 commit comments

Comments
 (0)