Change voicepack fallback to Default_qau
authorWuzzy <Wuzzy2@mail.ru>
Mon, 13 May 2019 23:44:00 +0200
changeset 14938 873dda2325c1
parent 14937 ff4003a90ff8
child 14939 0ec0ed2d9045
Change voicepack fallback to Default_qau
hedgewars/uSound.pas
--- a/hedgewars/uSound.pas	Mon May 13 23:13:53 2019 +0200
+++ b/hedgewars/uSound.pas	Mon May 13 23:44:00 2019 +0200
@@ -336,8 +336,9 @@
 
 function  AskForVoicepack(name: shortstring): Pointer;
 var i: Longword;
-    tmp, langName, path: shortstring;
+    tmp, nameStart, langName, path: shortstring;
 begin
+    nameStart:= name;
     i:= 0;
 
     { Adjust for language suffix: Voicepacks can have an optional language suffix.
@@ -368,13 +369,9 @@
 
     path:= cPathz[ptVoices] + '/' + name;
 
-    // Fallback to Default if voicepack can't be found at all
-    if (name <> 'Default') and (not pfsExists(path)) then
-        begin
-        path:= cPathz[ptVoices] + '/Default';
-        if pfsExists(path) then
-            exit(AskForVoicepack('Default'));
-        end;
+    // Fallback to localized Default if voicepack can't be found at all
+    if (nameStart <> 'Default_qau') and (not pfsExists(path)) then
+        exit(AskForVoicepack('Default_qau'));
 
     while (voicepacks[i].name <> name) and (voicepacks[i].name <> '') and (i < cMaxTeams) do
         begin