summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2014-08-03 11:55:46 +0200
committerGubolin <gubolin@fantasymail.de>2014-08-03 11:55:46 +0200
commita44775e4624f1afd9b83ffa4061152bfde2b829f (patch)
tree7901f4c9fb2f6a8a2b889d41ada17e08d46ac3f4
parentcc2f9bc84d5085e1380ceb3043d4ad5af3384b54 (diff)
downloadsnap-a44775e4624f1afd9b83ffa4061152bfde2b829f.tar.gz
snap-a44775e4624f1afd9b83ffa4061152bfde2b829f.zip
add volume out of bounds check
-rw-r--r--objects.js4
1 files changed, 2 insertions, 2 deletions
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
});
};