From 3190d2bb510017613914907ca632cdd325cc51e7 Mon Sep 17 00:00:00 2001 From: Cristiano Magro <cristiano.magro@vola.it> Date: Sun, 11 Oct 2020 18:05:52 +0200 Subject: [PATCH] fix some typo variable name --- technic_chests/register.lua | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 0d5150e..f8b108b 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -84,7 +84,6 @@ local function set_formspec(pos, data, page) local meta = minetest.get_meta(pos) - local node = minetest.get_node(pos) local formspec = data.base_formspec formspec = formspec..fs_helpers.cycling_button( meta, @@ -159,6 +158,16 @@ return function(pos, formname, fields, sender) local meta = minetest.get_meta(pos) local page = "main" + + local owner = meta:get_string("owner") + if owner ~= "" then + -- prevent modification of locked chests + if owner ~= sender:get_player_name() then return end + elseif not fields.quit then + -- prevent modification of protected chests + if minetest.is_protected(pos, sender:get_player_name()) then return end + end + if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then sort_inventory(meta:get_inventory()) end -- Gitblit v1.8.0