perf(inferium-harvester): do not continue when all needed seeds are removed
This commit is contained in:
parent
4502db1ba1
commit
6b36dd3c92
@ -361,7 +361,8 @@ end
|
||||
local function removeSeeds(seeds, config)
|
||||
goToHarvestPoint(config)
|
||||
|
||||
print('> remove ' .. utils.sizeof(seeds) .. ' seed(s)')
|
||||
local nbOfSeedsToRemove = utils.sizeof(seeds)
|
||||
print('> remove ' .. nbOfSeedsToRemove .. ' seed(s)')
|
||||
local stateSeeds = seeds -- warning: do not mutate the data (only the ref)
|
||||
|
||||
local nbBlockTraveled = 0
|
||||
@ -381,6 +382,10 @@ local function removeSeeds(seeds, config)
|
||||
end
|
||||
|
||||
stateSeeds = removeFirst(stateSeeds, found)
|
||||
nbOfSeedsToRemove = nbOfSeedsToRemove - 1
|
||||
if nbOfSeedsToRemove < 1 then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if i ~= config.length then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user