mirror of
https://github.com/minetest-mods/technic.git
synced 2024-11-18 00:08:36 +01:00
restrict field receive to owner only on locked chests
This commit is contained in:
parent
3dd8ce7a3d
commit
329d4dc783
@ -157,6 +157,16 @@ local function get_receive_fields(name, data)
|
|||||||
local lname = name:lower()
|
local lname = name:lower()
|
||||||
return function(pos, formname, fields, sender)
|
return function(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
local owner = meta:get_string("owner")
|
||||||
|
|
||||||
|
if owner and owner ~= "" and sender then
|
||||||
|
-- check owner
|
||||||
|
if owner ~= sender:get_player_name() then
|
||||||
|
-- not the owner
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local page = "main"
|
local page = "main"
|
||||||
if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then
|
if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then
|
||||||
sort_inventory(meta:get_inventory())
|
sort_inventory(meta:get_inventory())
|
||||||
|
Loading…
Reference in New Issue
Block a user