Stop fade-out sound instantly when audio muted
authorWuzzy <Wuzzy2@mail.ru>
Fri, 24 May 2019 12:31:30 +0200
changeset 15037 6c5502b9a038
parent 15036 7328f16bd299
child 15038 01bb1d7ca14f
Stop fade-out sound instantly when audio muted Fixes flamethrower sound not stopping at all when un-muting audio after flamethrower finished
hedgewars/uSound.pas
--- a/hedgewars/uSound.pas	Thu May 23 23:24:48 2019 +0300
+++ b/hedgewars/uSound.pas	Fri May 24 12:31:30 2019 +0200
@@ -830,7 +830,10 @@
         exit;
 
     if (chn <> -1) and (Mix_Playing(chn) <> 0) then
-        Mix_FadeOutChannel(chn, fadems);
+        if isAudioMuted then
+            Mix_HaltChannel(chn)
+        else
+            Mix_FadeOutChannel(chn, fadems);
 end;
 
 procedure PlayMusic;