diff options
| author | Gubolin <gubolin@fantasymail.de> | 2014-08-03 11:55:46 +0200 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2014-08-03 11:55:46 +0200 |
| commit | a44775e4624f1afd9b83ffa4061152bfde2b829f (patch) | |
| tree | 7901f4c9fb2f6a8a2b889d41ada17e08d46ac3f4 | |
| parent | cc2f9bc84d5085e1380ceb3043d4ad5af3384b54 (diff) | |
| download | snap-a44775e4624f1afd9b83ffa4061152bfde2b829f.tar.gz snap-a44775e4624f1afd9b83ffa4061152bfde2b829f.zip | |
add volume out of bounds check
| -rw-r--r-- | objects.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 }); }; |
