diff --git a/inferium-harvester.lua b/inferium-harvester.lua index f47b244..0827817 100644 --- a/inferium-harvester.lua +++ b/inferium-harvester.lua @@ -3,7 +3,7 @@ local utils = require('libs/utils') local turtleUtils = require('libs/turtle-utils') local config = require('config/harvesting') -local VERSION = "2.2.0" +local VERSION = "2.3.0" local INFERIUM_SERVER = 'inferium.com' local IDLE_TIME = 2 local WAIT_ITEM_IDLE_TIME = 5 @@ -399,6 +399,12 @@ local function replantSeeds() end local function replantProcedure() + local remotePlan = fetchRemotePlan() + + if remotePlan == nil then + error('cannot fetch the remote plan') + end + if localPlan == nil then retrieveLocalPlan() end @@ -407,12 +413,6 @@ local function replantProcedure() error('cannot retrieve the local plan') end - local remotePlan = fetchRemotePlan() - - if remotePlan == nil then - error('cannot fetch the remote plan') - end - local seedsToRemove = utils.shallowDiff(localPlan, remotePlan) local seedsToPlant = utils.shallowDiff(remotePlan, localPlan)