Fix broken fallback to sndFirePunch1 if sndFirePunch{2,6} is missing
authorWuzzy <Wuzzy2@mail.ru>
Tue, 27 Mar 2018 22:45:31 +0200
changeset 13287 29055da6a6cd
parent 13286 1fbf2ac1f13e
child 13288 ee8c6eb0ab47
Fix broken fallback to sndFirePunch1 if sndFirePunch{2,6} is missing
hedgewars/uSound.pas
--- a/hedgewars/uSound.pas	Tue Mar 27 19:59:12 2018 +0200
+++ b/hedgewars/uSound.pas	Tue Mar 27 22:45:31 2018 +0200
@@ -186,12 +186,12 @@
             (FileName:                  'Ow2.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw2
             (FileName:                  'Ow3.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw3
             (FileName:                  'Ow4.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw4
-            (FileName:           'Firepunch1.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch1
-            (FileName:           'Firepunch2.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch2
-            (FileName:           'Firepunch3.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch3
-            (FileName:           'Firepunch4.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch4
-            (FileName:           'Firepunch5.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch5
-            (FileName:           'Firepunch6.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch6
+            (FileName:           'Firepunch1.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch1
+            (FileName:           'Firepunch2.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch2
+            (FileName:           'Firepunch3.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch3
+            (FileName:           'Firepunch4.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch4
+            (FileName:           'Firepunch5.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch5
+            (FileName:           'Firepunch6.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch6
             (FileName:                'Melon.ogg'; Path: ptVoices; AltPath: ptNone),// sndMelon
             (FileName:              'Hellish.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellish
             (FileName:               'Yoohoo.ogg'; Path: ptSounds; AltPath: ptNone),// sndYoohoo
@@ -459,8 +459,12 @@
         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
             begin
             s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
+            // Fallback to sndFirePunch1 if sndFirePunch{2,6} is missing
             if (not pfsExists(s)) and (snd in [sndFirePunch2, sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6]) then
-                s:= cPathz[Soundz[sndFirePunch1].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
+                begin
+                snd := sndFirePunch1;
+                s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
+                end;
             WriteToConsole(msgLoading + s + ' ');
             rwops := rwopsOpenRead(s);