end
local function chest_lid_obstructed(pos)
- local above = { x = pos.x, y = pos.y + 1, z = pos.z }
+ local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local def = minetest.registered_nodes[minetest.get_node(above).name]
-- allow ladders, signs, wallmounted things and torches to not obstruct
- if def.drawtype == "airlike" or
+ if def and
+ (def.drawtype == "airlike" or
def.drawtype == "signlike" or
def.drawtype == "torchlike" or
- (def.drawtype == "nodebox" and def.paramtype2 == "wallmounted") then
+ (def.drawtype == "nodebox" and def.paramtype2 == "wallmounted")) then
return false
end
return true