Skip to content

Commit

Permalink
Fix bug in EVE Online mining bot
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Viir committed Oct 17, 2019
1 parent c3f15d7 commit 36964bc
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 36964bc

Please sign in to comment.