1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-22 16:10:18 +01:00

kaeza fixed node ownership detection for placing signs

This commit is contained in:
Vanessa 2013-03-22 23:26:54 -04:00
parent cc97a0ebd9
commit 349748e100

View File

@ -115,6 +115,12 @@ minetest.register_node(":default:sign_wall", {
groups = sign_groups,
on_place = function(itemstack, placer, pointed_thing)
local def = minetest.registered_nodes[minetest.env:get_node(pointed_thing.above).name]
if homedecor_node_is_owned(pointed_thing.above, placer)
or (not def.buildable_to) then
return itemstack
end
local node=minetest.env:get_node(pointed_thing.under)
if minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
@ -160,12 +166,6 @@ minetest.register_node(":default:sign_wall", {
sign_info = signs[fdir + 1]
end
local def = minetest.registered_nodes[minetest.env:get_node(pointed_thing.above).name]
if homedecor_node_is_owned(pointed_thing.above, placer)
or (not def.buildable_to) then
return
end
local text = minetest.env:add_entity({x = above.x + sign_info.delta.x,
y = above.y + sign_info.delta.y,
z = above.z + sign_info.delta.z}, "signs:text")