From 8d2f558ac393ecfc22ee64802f8d63476b2649c2 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 14 Sep 2016 10:17:49 -0700 Subject: [PATCH] Add proper cleanup on start of tutorial --- tutorial/tutorial.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tutorial/tutorial.js b/tutorial/tutorial.js index 5153070f44..ea2684fc89 100644 --- a/tutorial/tutorial.js +++ b/tutorial/tutorial.js @@ -226,7 +226,10 @@ stepWelcome.prototype = { showEntitiesWithTag(this.tag); }, cleanup: function() { - Script.clearTimeout(this.timerID); + if (this.timerID) { + Script.clearTimeout(this.timerID); + this.timerID = null; + } hideEntitiesWithTag(this.tag); } }; @@ -809,7 +812,10 @@ function startTutorial() { new stepTurnAround("turnAround"), new stepTeleport("teleport"), new stepFinish("finish"), - ] + ]; + for (var i = 0; i < STEPS.length; ++i) { + STEPS[i].cleanup(); + } //location = "/tutorial_begin"; location = "/tutorial"; startNextStep();