diff --git a/src/core/Chef.mjs b/src/core/Chef.mjs index 4d1ff994..e7eb03ec 100755 --- a/src/core/Chef.mjs +++ b/src/core/Chef.mjs @@ -53,7 +53,7 @@ class Chef { this.dish.set(input, type); try { - progress = await recipe.execute(this.dish, progress); + progress = await recipe.execute(this.dish); } catch (err) { log.error(err); error = { diff --git a/src/core/Recipe.mjs b/src/core/Recipe.mjs index 14cb39b7..8c898421 100755 --- a/src/core/Recipe.mjs +++ b/src/core/Recipe.mjs @@ -169,25 +169,23 @@ class Recipe { * Executes each operation in the recipe over the given Dish. * * @param {Dish} dish - * @param {number} [startFrom=0] - * - The index of the Operation to start executing from * @param {number} [forkState={}] * - If this is a forked recipe, the state of the recipe up to this point * @returns {number} * - The final progress through the recipe */ - async execute(dish, startFrom=0, forkState={}) { + async execute(dish, forkState={}) { let op, input, output, numJumps = 0, numRegisters = forkState.numRegisters || 0; - if (startFrom === 0) this.lastRunOp = null; + this.lastRunOp = null; await this._hydrateOpList(); - log.debug(`[*] Executing recipe of ${this.opList.length} operations, starting at ${startFrom}`); + log.debug(`[*] Executing recipe of ${this.opList.length} operations`); - for (let i = startFrom; i < this.opList.length; i++) { + for (let i = 0; i < this.opList.length; i++) { op = this.opList[i]; log.debug(`[${i}] ${op.name} ${JSON.stringify(op.ingValues)}`); if (op.disabled) { diff --git a/src/core/operations/Fork.mjs b/src/core/operations/Fork.mjs index 6e961990..0dbd4b88 100644 --- a/src/core/operations/Fork.mjs +++ b/src/core/operations/Fork.mjs @@ -97,7 +97,7 @@ class Fork extends Operation { dish.set(inputs[i], inputType); try { - progress = await recipe.execute(dish, 0, state); + progress = await recipe.execute(dish, state); } catch (err) { if (!ignoreErrors) { throw err; diff --git a/src/core/operations/Subsection.mjs b/src/core/operations/Subsection.mjs index 86980e40..2c2bd959 100644 --- a/src/core/operations/Subsection.mjs +++ b/src/core/operations/Subsection.mjs @@ -123,7 +123,7 @@ class Subsection extends Operation { dish.set(matchStr, inputType); try { - progress = await recipe.execute(dish, 0, state); + progress = await recipe.execute(dish, state); } catch (err) { if (!ignoreErrors) { throw err;