Fix #327, "switch costume to [next/previous]" (#330)

This commit is contained in:
Tim Mickel 2016-11-09 11:22:17 -05:00 committed by GitHub
parent f5ee6a7e58
commit b99f089ae7

View file

@ -94,11 +94,11 @@ Scratch3LooksBlocks.prototype._setCostumeOrBackdrop = function (target,
var costumeIndex = target.getCostumeIndexByName(requestedCostume);
if (costumeIndex > -1) {
target.setCostume(costumeIndex);
} else if (costumeIndex === 'previous costume' ||
costumeIndex === 'previous backdrop') {
} else if (requestedCostume === 'previous costume' ||
requestedCostume === 'previous backdrop') {
target.setCostume(target.currentCostume - 1);
} else if (costumeIndex === 'next costume' ||
costumeIndex === 'next backdrop') {
} else if (requestedCostume === 'next costume' ||
requestedCostume === 'next backdrop') {
target.setCostume(target.currentCostume + 1);
} else {
var forcedNumber = Cast.toNumber(requestedCostume);