From ebdf3865d4dc17b0bb885f10fb36f517c2b9ba73 Mon Sep 17 00:00:00 2001 From: "Michael \"Z\" Goddard" Date: Fri, 19 Apr 2019 15:50:44 -0400 Subject: [PATCH] retire new threads if they have no block after the hat --- src/engine/sequencer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/sequencer.js b/src/engine/sequencer.js index 464cd7489..61a758f0a 100644 --- a/src/engine/sequencer.js +++ b/src/engine/sequencer.js @@ -177,6 +177,12 @@ class Sequencer { if (!currentBlockId) { // A "null block" - empty branch. thread.popStack(); + + // Did the null follow a hat block? + if (thread.stack.length === 0) { + thread.status = Thread.STATUS_DONE; + return; + } } // Save the current block ID to notice if we did control flow. while ((currentBlockId = thread.peekStack())) {