Code tweak for meta check
This commit is contained in:
parent
511906aa01
commit
1cf0a3c081
7
init.lua
7
init.lua
@ -61,7 +61,9 @@ end
|
||||
protector.generate_formspec = function(meta)
|
||||
|
||||
local formspec = "size[8,7]"
|
||||
..default.gui_bg..default.gui_bg_img..default.gui_slots
|
||||
.. 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)]"
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user