diff options
author | Beha <shacknetisp@mail.com> | 2017-03-25 22:53:20 -0400 |
---|---|---|
committer | Beha <shacknetisp@mail.com> | 2017-03-25 22:53:20 -0400 |
commit | 16312b1ce1df39e18fefff923c11c000e081986d (patch) | |
tree | 2349488c7cee1442a6e22d9feda160b0d31a24c3 | |
parent | 90a0a553d9b58ac691b2cbeaef19f76b52c2189c (diff) |
on_rightclick safety checks.
-rw-r--r-- | init.lua | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |