From 8684bfda603eb2782b3f6fb88f036a3066750fca Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Sun, 18 Jun 2017 16:05:46 -0500 Subject: [PATCH] Fixed bug with tutorial after update to tail command --- src/Terminal.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Terminal.js b/src/Terminal.js index bcaea1a78..c60b22c4b 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -551,12 +551,13 @@ var Terminal = { case iTutorialSteps.ActiveScriptsToTerminal: if (commandArray.length == 2 && commandArray[0] == "tail" && commandArray[1] == "foodnstuff.script") { - var currScripts = Player.getCurrentServer().scripts; - for (var i = 0; i < currScripts.length; ++i) { - if ("foodnstuff.script" == currScripts[i].filename) { - currScripts[i].displayLog(); - } + //Check that the script exists on this machine + var runningScript = findRunningScript("foodnstuff.script", [], Player.getCurrentServer()); + if (runningScript == null) { + post("Error: No such script exists"); + return; } + logBoxCreate(runningScript); iTutorialNextStep(); } else {post("Bad command. Please follow the tutorial");} break;