From c45b4201157a6a761713281775610612d245b032 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Thu, 13 Oct 2016 22:14:19 -0400 Subject: [PATCH] Fix check for existing hat threads (#269) --- src/engine/runtime.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 952dd213e..f78424109 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -344,7 +344,7 @@ Runtime.prototype.startHats = function (requestedHatOpcode, // any existing threads starting with the top block. for (var i = 0; i < instance.threads.length; i++) { if (instance.threads[i].topBlock === topBlockId && - (!opt_target || instance.threads[i].target == opt_target)) { + instance.threads[i].target == target) { instance._removeThread(instance.threads[i]); } } @@ -353,7 +353,7 @@ Runtime.prototype.startHats = function (requestedHatOpcode, // give up if any threads with the top block are running. for (var j = 0; j < instance.threads.length; j++) { if (instance.threads[j].topBlock === topBlockId && - (!opt_target || instance.threads[j].target == opt_target)) { + instance.threads[j].target == target) { // Some thread is already running. return; }