diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-02-21 21:11:36 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-02-21 21:11:36 +0000 |
commit | 1cf0a3c081cba36550725004a9194b481bcb464c (patch) | |
tree | 43a2de730cdae4944b01ba4e852dc452c2f367b3 | |
parent | 511906aa01bf119d4c29954c3b9d916291b3a9fd (diff) |
Code tweak for meta check
-rw-r--r-- | init.lua | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -61,10 +61,12 @@ end protector.generate_formspec = function(meta) local formspec = "size[8,7]" - ..default.gui_bg..default.gui_bg_img..default.gui_slots - .."label[2.5,0;-- Protector interface --]" - .."label[0,1;PUNCH node to show protected area or USE for area check]" - .."label[0,2;Members: (type player name then press Enter to add)]" + .. default.gui_bg + .. default.gui_bg_img + .. default.gui_slots + .. "label[2.5,0;-- Protector interface --]" + .. "label[0,1;PUNCH node to show protected area or USE for area check]" + .. "label[0,2;Members: (type player name then press Enter to add)]" .. "button_exit[2.5,6.2;3,0.5;close_me;Close]" local members = protector.get_member_list(meta) @@ -320,7 +322,8 @@ minetest.register_node("protector:protect", { local meta = minetest.get_meta(pos) - if protector.can_dig(1, pos,clicker:get_player_name(), true, 1) then + if meta + and protector.can_dig(1, pos,clicker:get_player_name(), true, 1) then minetest.show_formspec(clicker:get_player_name(), "protector:node_" .. minetest.pos_to_string(pos), protector.generate_formspec(meta)) end |