Add proper cleanup on start of tutorial

This commit is contained in:
Ryan Huffman 2016-09-14 10:17:49 -07:00
parent 4adc83da84
commit 8d2f558ac3

View file

@ -226,7 +226,10 @@ stepWelcome.prototype = {
showEntitiesWithTag(this.tag); showEntitiesWithTag(this.tag);
}, },
cleanup: function() { cleanup: function() {
Script.clearTimeout(this.timerID); if (this.timerID) {
Script.clearTimeout(this.timerID);
this.timerID = null;
}
hideEntitiesWithTag(this.tag); hideEntitiesWithTag(this.tag);
} }
}; };
@ -809,7 +812,10 @@ function startTutorial() {
new stepTurnAround("turnAround"), new stepTurnAround("turnAround"),
new stepTeleport("teleport"), new stepTeleport("teleport"),
new stepFinish("finish"), new stepFinish("finish"),
] ];
for (var i = 0; i < STEPS.length; ++i) {
STEPS[i].cleanup();
}
//location = "/tutorial_begin"; //location = "/tutorial_begin";
location = "/tutorial"; location = "/tutorial";
startNextStep(); startNextStep();