treat numeric input to sound name as 1-indexed

This commit is contained in:
Eric Rosenbaum 2017-01-04 14:41:14 -05:00
parent 7a49a3ae43
commit 3bf9238e0c

View file

@ -56,7 +56,7 @@ Scratch3SoundBlocks.prototype._getSoundIndex = function (soundName, util) {
}
if (typeof soundName === 'number') {
var len = util.target.sprite.sounds.length;
index = MathUtil.wrapClamp(soundName, 0, len - 1);
index = MathUtil.wrapClamp(soundName, 1, len) - 1;
} else {
index = util.target.getSoundIndexByName(soundName);
if (index === -1) {