on_rightclick safety checks.

master
Beha 2017-03-25 22:53:20 -04:00
parent 90a0a553d9
commit 16312b1ce1
1 changed files with 4 additions and 1 deletions

View File

@ -453,10 +453,13 @@ for _,mode in ipairs({"on", "off"}) do
if (node ~= nil and node.name ~= "air" and node.name ~= placeholder) then
return
end
return minetest.item_place(itemstack, placer, pointed_thing);
return minetest.item_place(itemstack, placer, pointed_thing)
end,
on_rightclick = function(pos, node, sender)
if not sender or not sender:is_player() then
return
end
local meta = minetest.get_meta(pos)
formspecs[sender:get_player_name()] = {pos}
if on then