Clear all other sounds before playing flawless victory / victory 0.9.17
authornemo
Sun, 13 Nov 2011 13:18:56 -0500
branch0.9.17
changeset 6360 eca20f8990e2
parent 6359 37bb74f0dae9
child 6361 bc157c3dac43
child 6366 1a49a8fcca56
Clear all other sounds before playing flawless victory / victory
hedgewars/uSound.pas
--- a/hedgewars/uSound.pas	Sun Nov 13 13:05:19 2011 -0500
+++ b/hedgewars/uSound.pas	Sun Nov 13 13:18:56 2011 -0500
@@ -287,6 +287,13 @@
 var i : LongInt;
 begin
     if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd = snd) and  (LastVoice.voicepack = voicepack)) then exit;
+    if (snd = sndVictory) or (snd = sndFlawless) then
+        begin
+        for i:= 1 to Succ(chanTPU) do StopSound(i);
+        for i:= 0 to 7 do VoiceList[i].snd:= sndNone;
+        LastVoice.snd:= sndNone;
+        end;
+
     i:= 0;
     while (i<8) and (VoiceList[i].snd <> sndNone) do inc(i);