Merge pull request #19 from kaeza/master

Various fixes and additions
This commit is contained in:
VanessaE 2013-05-20 18:11:06 -07:00
commit 5fe3519aab
2 changed files with 19 additions and 5 deletions

View File

@ -49,6 +49,10 @@ function homedecor_node_is_owned(pos, placer)
if not isprotect(5, pos, placer) then
ownername = S("someone")
end
elseif type(protector)=="table" and type(protector.can_dig)=="function" then -- Zeg9's protection mod
if not protector.can_dig(5, pos, placer) then
ownername = S("someone")
end
end
if ownername ~= false then

View File

@ -115,11 +115,20 @@ 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]
local name
name = minetest.env:get_node(pointed_thing.under).name
if fences_with_sign[name] then
if homedecor_node_is_owned(pointed_thing.under, placer) then
return itemstack
end
else
name = minetest.env:get_node(pointed_thing.above).name
local def = minetest.registered_nodes[name]
if homedecor_node_is_owned(pointed_thing.above, placer)
or (not def.buildable_to) then
return itemstack
end
end
local node=minetest.env:get_node(pointed_thing.under)
@ -432,6 +441,7 @@ function homedecor_register_fence_with_sign(fencename, fencewithsignname)
minetest.pos_to_string(pos)
))
end
if not homedecor_node_is_owned(pos, sender) then return end
homedecor_update_sign(pos, fields)
end
def_sign.on_punch = function(pos, node, puncher, ...)