fix nil refs caused by a renamed function

This commit is contained in:
Vanessa Ezekowitz 2013-11-08 04:49:32 -05:00
parent c8be033292
commit 0063598f22
4 changed files with 22 additions and 20 deletions

View File

@ -444,8 +444,8 @@ function homedecor.place_door(itemstack, placer, pointed_thing, name, forceright
local node_bottom = minetest.get_node(pos1)
local node_top = minetest.get_node(pos2)
if not homedecor:node_is_owned(pos1, placer)
and not homedecor:node_is_owned(pos2, placer) then
if not homedecor.node_is_owned(pos1, placer)
and not homedecor.node_is_owned(pos2, placer) then
if not get_nodedef_field(node_bottom.name, "buildable_to")
or not get_nodedef_field(node_top.name, "buildable_to") then

View File

@ -59,17 +59,6 @@ function homedecor.table_copy(t)
return nt
end
-- protection wrapper for 6d stuff
function homedecor.protect_and_rotate(itemstack, placer, pointed_thing)
if not homedecor.node_is_owned(pointed_thing.under, placer)
and not homedecor.node_is_owned(pointed_thing.above, placer) then
local keys=placer:get_player_control()
minetest.rotate_and_place(itemstack, placer, pointed_thing,
homedecor.expect_infinite_stacks, {invert_wall = keys.sneak})
end
return itemstack
end
-- load various other components

View File

@ -33,3 +33,16 @@ function homedecor.node_is_owned(pos, placer)
return false
end
end
-- protection wrapper for 6d stuff
function homedecor.protect_and_rotate(itemstack, placer, pointed_thing)
if not homedecor.node_is_owned(pointed_thing.under, placer)
and not homedecor.node_is_owned(pointed_thing.above, placer) then
local keys=placer:get_player_control()
minetest.rotate_and_place(itemstack, placer, pointed_thing,
homedecor.expect_infinite_stacks, {invert_wall = keys.sneak})
end
return itemstack
end

View File

@ -386,13 +386,13 @@ if not homedecor.disable_signs then
local name
name = minetest.get_node(pointed_thing.under).name
if fences_with_sign[name] then
if homedecor:node_is_owned(pointed_thing.under, placer) then
if homedecor.node_is_owned(pointed_thing.under, placer) then
return itemstack
end
else
name = minetest.get_node(pointed_thing.above).name
local def = minetest.registered_nodes[name]
if homedecor:node_is_owned(pointed_thing.above, placer)
if homedecor.node_is_owned(pointed_thing.above, placer)
or (not def.buildable_to) then
return itemstack
end
@ -469,7 +469,7 @@ if not homedecor.disable_signs then
minetest.pos_to_string(pos)
))
end
if homedecor:node_is_owned(pos, sender) then return end
if homedecor.node_is_owned(pos, sender) then return end
homedecor.update_sign(pos, fields)
end,
on_punch = function(pos, node, puncher)
@ -506,7 +506,7 @@ minetest.register_node(":signs:sign_yard", {
minetest.pos_to_string(pos)
))
end
if homedecor:node_is_owned(pos, sender) then return end
if homedecor.node_is_owned(pos, sender) then return end
homedecor.update_sign(pos, fields)
end,
on_punch = function(pos, node, puncher)
@ -597,7 +597,7 @@ function homedecor.register_fence_with_sign(fencename, fencewithsignname)
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
if def_under and def_under.on_rightclick then
return def_under.on_rightclick(pointed_thing.under, node_under, placer, itemstack) or itemstack
elseif (not homedecor:node_is_owned(pointed_thing.under, placer))
elseif (not homedecor.node_is_owned(pointed_thing.under, placer))
and def_under.buildable_to then
minetest.add_node(pointed_thing.under, {name = fencename, param2 = fdir})
if not homedecor.expect_infinite_stacks then
@ -605,7 +605,7 @@ function homedecor.register_fence_with_sign(fencename, fencewithsignname)
end
placer:set_wielded_item(itemstack)
return itemstack
elseif (not homedecor:node_is_owned(pointed_thing.above, placer))
elseif (not homedecor.node_is_owned(pointed_thing.above, placer))
and def_above.buildable_to then
minetest.add_node(pointed_thing.above, {name = fencename, param2 = fdir})
if not homedecor.expect_infinite_stacks then
@ -629,7 +629,7 @@ function homedecor.register_fence_with_sign(fencename, fencewithsignname)
minetest.pos_to_string(pos)
))
end
if homedecor:node_is_owned(pos, sender) then return end
if homedecor.node_is_owned(pos, sender) then return end
homedecor.update_sign(pos, fields)
end
def_sign.on_punch = function(pos, node, puncher, ...)