Mine: fix is_block_precious

This commit is contained in:
Théophile Bastian 2020-08-19 23:38:48 +02:00
parent 9ad825fc60
commit f3fdbaad9c

View file

@ -22,7 +22,7 @@ FUEL_POINT_S = 3
FUEL_EXPECTATION = 2000
FUEL_LOW = 1000
SHAFT_DEPTH = 100
SHAFT_DEPTH = 5
-- Start at this position to find the next shaft
next_shaft_side = 0
@ -240,10 +240,10 @@ function is_block_precious(block)
}
if block then
for id, refblock in ipairs(WORTHY_BLOCKS) do
if block['name'] == refblock['name'] then
if (refblock['state_type']
and block['state'] and block['state']['type']
and block['state']['type'] == refblock['state_type']) then
if block.name == refblock.name then
if (refblock.state_type
and block.state and block.state.type
and block.state.type == refblock.state_type) then
return true
end
end