Fix nil check assertions
This commit is contained in:
parent
408fed1ad2
commit
f6b76a522f
18
quarry.lua
18
quarry.lua
@ -79,7 +79,7 @@ end
|
||||
local function handleFullInv(minEmpty)
|
||||
local didPlace = false
|
||||
|
||||
local result, drop, dig, onComplete
|
||||
local result, drop, dig, onComplete = false, nil, nil, nil
|
||||
-- Empty inventory
|
||||
while isFull(minEmpty) do
|
||||
if not didPlace then
|
||||
@ -117,14 +117,16 @@ local function handleFullInv(minEmpty)
|
||||
::continue::
|
||||
end
|
||||
|
||||
assert(dig ~= nil, "Placed chest, but dig operation is nil")
|
||||
if didPlace and CHEST_PICKUP then
|
||||
turtle.select(CHEST_SLOT)
|
||||
dig()
|
||||
if result then
|
||||
assert(dig ~= nil, "Placed chest, but dig operation is nil")
|
||||
if didPlace and CHEST_PICKUP then
|
||||
turtle.select(CHEST_SLOT)
|
||||
dig()
|
||||
end
|
||||
|
||||
assert(onComplete ~= nil, "Placed chest, but onComplete operation is nil")
|
||||
onComplete()
|
||||
end
|
||||
|
||||
assert(onComplete ~= nil, "Placed chest, but onComplete operation is nil")
|
||||
onComplete()
|
||||
end
|
||||
|
||||
local function dig(checkRefuel)
|
||||
|
Loading…
x
Reference in New Issue
Block a user