diff --git a/compat-chests.lua b/compat-chests.lua index b996871..5465bfb 100644 --- a/compat-chests.lua +++ b/compat-chests.lua @@ -52,14 +52,13 @@ if minetest.get_modpath("default") then end local pn = player:get_player_name() local chest_open = default.chest.open_chests[pn] - if not chest_open then + if not chest_open or not chest_open.pos then -- chest already closed before formspec return end local pos = chest_open.pos - local chest = pos and minetest.get_node(pos) - local is_pipeworks_chest = chest and pipeworks.chests[chest] - if is_pipeworks_chest and pipeworks.may_configure(pos, player) then + local node = minetest.get_node(pos) + if pipeworks.chests[node.name] and pipeworks.may_configure(pos, player) then -- Pipeworks Switch fs_helpers.on_receive_fields(pos, fields) minetest.show_formspec(pn,