From 90269a7e4ff560dbf2a2edf76811e85653b2fc4b Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 29 May 2021 19:36:15 +0200 Subject: [PATCH] added priv check for inventory access --- inventory.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inventory.lua b/inventory.lua index 86687b5..ec9b942 100644 --- a/inventory.lua +++ b/inventory.lua @@ -42,8 +42,15 @@ yl_speak_up.get_fs_inventory = function(player) return "size[6,2]".. "label[0.2,0.5;Ups! This NPC lacks ID or name.]".. "button_exit[2,1.5;1,0.9;exit;Exit]" - end + + -- only players which can edit this npc can see its inventory + if(not(yl_speak_up.may_edit_npc(player, n_id))) then + return "size[6,2]".. + "label[0.2,0.5;Sorry. You lack the privileges.]".. + "button_exit[2,1.5;1,0.9;exit;Exit]" + end + return "size[12,11]" .. "label[2,-0.2;Inventory of "..minetest.formspec_escape(dialog.n_npc).. " (ID: "..tostring(n_id).."):]"..