forked from mtcontrib/unifieddyes
only allow placing the wielded thing if it's actually a node
This commit is contained in:
parent
1426efb517
commit
00459f8859
3
init.lua
3
init.lua
@ -183,7 +183,8 @@ function unifieddyes.on_rightclick(pos, node, player, stack, pointed_thing, newn
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
local pos2 = unifieddyes.select_node(pointed_thing)
|
local pos2 = unifieddyes.select_node(pointed_thing)
|
||||||
if unifieddyes.is_buildable_to(player:get_player_name(), pos2) then
|
if unifieddyes.is_buildable_to(player:get_player_name(), pos2) and
|
||||||
|
minetest.registered_nodes[name] then
|
||||||
local oldnode = minetest.registered_nodes[stack:get_name()]
|
local oldnode = minetest.registered_nodes[stack:get_name()]
|
||||||
minetest.set_node(pos2, oldnode)
|
minetest.set_node(pos2, oldnode)
|
||||||
stack:take_item()
|
stack:take_item()
|
||||||
|
Loading…
Reference in New Issue
Block a user