forked from your-land-mirror/yl_speak_up
do not right-click on nodes with a formspec
This commit is contained in:
parent
0784b86b1d
commit
151b55581c
@ -524,8 +524,14 @@ yl_speak_up.execute_effect = function(player, n_id, o_id, r)
|
|||||||
if(not(node) or not(node.name) or not(minetest.registered_nodes[node.name])) then
|
if(not(node) or not(node.name) or not(minetest.registered_nodes[node.name])) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
-- TODO: do not right-click nodes that have a metadata formspec string
|
-- do not right-click nodes that have a metadata formspec string
|
||||||
-- TODO: do not right-click nodes that have an inventory (they most likely show a formspec - which the NPC can't use anyway)
|
local meta = minetest.get_meta(r.r_pos)
|
||||||
|
if(meta and meta:get_string("formspec") and meta:get_string("formspec") ~= "") then
|
||||||
|
yl_speak_up.debug_msg(player, n_id, o_id, tostring(r.r_id).." "..
|
||||||
|
"block: right-click - The block at "..pos_str.." has a "..
|
||||||
|
"formspec set. NPC can't read these. Interaction not possible.")
|
||||||
|
return false
|
||||||
|
end
|
||||||
-- is it a door?
|
-- is it a door?
|
||||||
if(doors.registered_doors[node.name]) then
|
if(doors.registered_doors[node.name]) then
|
||||||
doors.door_toggle( r.r_pos, node, nil) --, clicker)
|
doors.door_toggle( r.r_pos, node, nil) --, clicker)
|
||||||
|
Loading…
Reference in New Issue
Block a user