From 36964bc8fecbc70db38a20656b9056178d6caacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20R=C3=A4tzel?= Date: Thu, 17 Oct 2019 16:16:38 +0000 Subject: [PATCH] Fix bug in EVE Online mining bot In the previous version, the bot would display the error message in the beginning. The bug also led to a delay by one step at the end of each sequence. --- .../eve-online/mutant-wizard-mining-bot/src/Bot.elm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/implement/applications/eve-online/mutant-wizard-mining-bot/src/Bot.elm b/implement/applications/eve-online/mutant-wizard-mining-bot/src/Bot.elm index d34e5f3f..4ff73a48 100644 --- a/implement/applications/eve-online/mutant-wizard-mining-bot/src/Bot.elm +++ b/implement/applications/eve-online/mutant-wizard-mining-bot/src/Bot.elm @@ -270,7 +270,11 @@ simpleProcessEvent eventAtTime stateBefore = SimpleSanderling.MemoryMeasurementCompleted memoryMeasurement -> let remainingSequenceBefore = - stateBefore.remainingSequence + if 0 < (stateBefore.remainingSequence.steps |> List.length) then + stateBefore.remainingSequence + + else + getProgramSequence stateBefore.remainingSequence.continueWith ( stepResult, stepDescription ) = -- 'remainingSequence' stores only the remaining steps, so we always execute the first of the steps in there. @@ -282,11 +286,7 @@ simpleProcessEvent eventAtTime stateBefore = ( decideBasedOnMemoryMeasurement memoryMeasurement, currentStepDescription ) advancedSequence = - if (remainingSequenceBefore.steps |> List.length) > 0 then - { remainingSequenceBefore | steps = remainingSequenceBefore.steps |> List.drop 1 } - - else - remainingSequenceBefore.continueWith |> getProgramSequence + { remainingSequenceBefore | steps = remainingSequenceBefore.steps |> List.drop 1 } ( remainingSequence, effects ) = case stepResult of