From a44775e4624f1afd9b83ffa4061152bfde2b829f Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 3 Aug 2014 11:55:46 +0200 Subject: add volume out of bounds check --- objects.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 317a96a..fda06f6 100644 --- a/objects.js +++ b/objects.js @@ -2637,9 +2637,9 @@ SpriteMorph.prototype.playSound = function (name) { SpriteMorph.prototype.doSetVolume = function (val) { var myself = this; - myself.volume = val; + myself.volume = Math.min(Math.max(0, val), 100); myself.activeSounds.forEach(function (snd) { - snd.volume = Math.min(Math.max(0, myself.volume), 100) / 100; // 'audio' objects + snd.volume = myself.volume / 100; // 'audio' objects }); }; -- cgit v1.3.1