diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/talk.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c index fb2f9cf3df..ddc95e697b 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -1587,7 +1587,21 @@ void talk_announce_voice_invalid(void) | |||
1587 | int buf_handle; | 1587 | int buf_handle; |
1588 | struct queue_entry qe; | 1588 | struct queue_entry qe; |
1589 | 1589 | ||
1590 | const char talkfile[] = LANG_DIR "/InvalidVoice_" DEFAULT_VOICE_LANG ".talk"; | 1590 | char talkfile[MAX_PATH]; |
1591 | const char* const p_lang_def = DEFAULT_VOICE_LANG; /* default */ | ||
1592 | const char* p_lang = p_lang_def; | ||
1593 | |||
1594 | /* attempt to load Invalid voice clip in proper lang otherwise use default */ | ||
1595 | if (global_settings.lang_file[0] && global_settings.lang_file[0] != 0xff) | ||
1596 | p_lang = global_settings.lang_file; | ||
1597 | |||
1598 | while(1) | ||
1599 | { | ||
1600 | snprintf(talkfile, sizeof(talkfile), LANG_DIR "/InvalidVoice_%s.talk", p_lang); | ||
1601 | if (file_exists(talkfile) || p_lang == p_lang_def) | ||
1602 | break; /* if it exists or default talk file doesn't exist give up */ | ||
1603 | p_lang = p_lang_def; | ||
1604 | } | ||
1591 | 1605 | ||
1592 | if (global_settings.talk_menu && talk_status != TALK_STATUS_OK) | 1606 | if (global_settings.talk_menu && talk_status != TALK_STATUS_OK) |
1593 | { | 1607 | { |