diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index c410b21..a1da921 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -1801,11 +1801,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if formname ~= "default:chest" then return end - if not fields.quit then + if not player or not fields.quit then return end local pn = player:get_player_name() + if not open_chests[pn] then + return + end + local pos = open_chests[pn].pos local sound = open_chests[pn].sound local swap = open_chests[pn].swap