thought I was being smart by using inline assignment, but noooooo

This commit is contained in:
Kenny2github 2018-05-08 08:27:51 +08:00
parent e3b7f53319
commit 3f1c4aa2d8

View file

@ -344,7 +344,8 @@ class Scratch3LooksBlocks {
requestedCostume === 'next backdrop') {
target.setCostume(target.currentCostume + 1);
} else if (requestedCostume === 'random backdrop') {
if ((numCostumes = target.getCostumes().length) > 1) {
const numCostumes = target.getCostumes().length;
if (numCostumes > 1) {
let index;
do {
index = Math.floor(Math.random() * numCostumes);