From e61fffe2f2455017ff95761a3f80d4fd3ef4bdf1 Mon Sep 17 00:00:00 2001 From: msb Date: Mon, 19 Sep 2016 22:11:43 +0100 Subject: [PATCH] Fix for no audio - even when mute is disabled --- game.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/game.js b/game.js index 4f0a717..1cce7a4 100644 --- a/game.js +++ b/game.js @@ -851,15 +851,11 @@ for (var sfx in SFX) { audio.play(); SFX[sfx] = function () { - if (!this.muted) { - if (audio.duration == 0) { - // somehow dropped out - audio.load(); - audio.play(); - } else { - audio.muted = false; - audio.currentTime = 0; - } + if (!SFX.muted) { + audio.muted = false; + audio.pause(); + audio.currentTime = 0; + audio.play(); } return audio; }