diff --git a/src/blocks/scratch3_event.js b/src/blocks/scratch3_event.js index 60792345..b47ba014 100644 --- a/src/blocks/scratch3_event.js +++ b/src/blocks/scratch3_event.js @@ -76,7 +76,8 @@ Scratch3EventBlocks.prototype.broadcastAndWait = function (args, util) { var waiting = false; for (var i = 0; i < util.stackFrame.triggeredThreads.length; i++) { var thread = util.stackFrame.triggeredThreads[i]; - if (thread.status !== Thread.STATUS_DONE) { + var activeThreads = this.runtime.threads; + if (activeThreads.indexOf(thread) > -1) { // @todo: A cleaner way? waiting = true; } } diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 62a08321..1d591c7a 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -204,7 +204,6 @@ Runtime.prototype._pushThread = function (id) { * @param {?Thread} thread Thread object to remove from actives */ Runtime.prototype._removeThread = function (thread) { - thread.setStatus(Thread.STATUS_DONE); var i = this.threads.indexOf(thread); if (i > -1) { this.glowScript(thread.topBlock, false);