mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-23 16:30:21 +01:00
fix nil refs caused by a renamed function
This commit is contained in:
parent
c8be033292
commit
0063598f22
@ -444,8 +444,8 @@ function homedecor.place_door(itemstack, placer, pointed_thing, name, forceright
|
|||||||
local node_bottom = minetest.get_node(pos1)
|
local node_bottom = minetest.get_node(pos1)
|
||||||
local node_top = minetest.get_node(pos2)
|
local node_top = minetest.get_node(pos2)
|
||||||
|
|
||||||
if not homedecor:node_is_owned(pos1, placer)
|
if not homedecor.node_is_owned(pos1, placer)
|
||||||
and not homedecor:node_is_owned(pos2, placer) then
|
and not homedecor.node_is_owned(pos2, placer) then
|
||||||
|
|
||||||
if not get_nodedef_field(node_bottom.name, "buildable_to")
|
if not get_nodedef_field(node_bottom.name, "buildable_to")
|
||||||
or not get_nodedef_field(node_top.name, "buildable_to") then
|
or not get_nodedef_field(node_top.name, "buildable_to") then
|
||||||
|
11
init.lua
11
init.lua
@ -59,17 +59,6 @@ function homedecor.table_copy(t)
|
|||||||
return nt
|
return nt
|
||||||
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
|
|
||||||
|
|
||||||
-- load various other components
|
-- load various other components
|
||||||
|
|
||||||
|
@ -33,3 +33,16 @@ function homedecor.node_is_owned(pos, placer)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
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
|
||||||
|
|
||||||
|
@ -386,13 +386,13 @@ if not homedecor.disable_signs then
|
|||||||
local name
|
local name
|
||||||
name = minetest.get_node(pointed_thing.under).name
|
name = minetest.get_node(pointed_thing.under).name
|
||||||
if fences_with_sign[name] then
|
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
|
return itemstack
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
name = minetest.get_node(pointed_thing.above).name
|
name = minetest.get_node(pointed_thing.above).name
|
||||||
local def = minetest.registered_nodes[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
|
or (not def.buildable_to) then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -469,7 +469,7 @@ if not homedecor.disable_signs then
|
|||||||
minetest.pos_to_string(pos)
|
minetest.pos_to_string(pos)
|
||||||
))
|
))
|
||||||
end
|
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)
|
homedecor.update_sign(pos, fields)
|
||||||
end,
|
end,
|
||||||
on_punch = function(pos, node, puncher)
|
on_punch = function(pos, node, puncher)
|
||||||
@ -506,7 +506,7 @@ minetest.register_node(":signs:sign_yard", {
|
|||||||
minetest.pos_to_string(pos)
|
minetest.pos_to_string(pos)
|
||||||
))
|
))
|
||||||
end
|
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)
|
homedecor.update_sign(pos, fields)
|
||||||
end,
|
end,
|
||||||
on_punch = function(pos, node, puncher)
|
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())
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
if def_under and def_under.on_rightclick then
|
if def_under and def_under.on_rightclick then
|
||||||
return def_under.on_rightclick(pointed_thing.under, node_under, placer, itemstack) or itemstack
|
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
|
and def_under.buildable_to then
|
||||||
minetest.add_node(pointed_thing.under, {name = fencename, param2 = fdir})
|
minetest.add_node(pointed_thing.under, {name = fencename, param2 = fdir})
|
||||||
if not homedecor.expect_infinite_stacks then
|
if not homedecor.expect_infinite_stacks then
|
||||||
@ -605,7 +605,7 @@ function homedecor.register_fence_with_sign(fencename, fencewithsignname)
|
|||||||
end
|
end
|
||||||
placer:set_wielded_item(itemstack)
|
placer:set_wielded_item(itemstack)
|
||||||
return 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
|
and def_above.buildable_to then
|
||||||
minetest.add_node(pointed_thing.above, {name = fencename, param2 = fdir})
|
minetest.add_node(pointed_thing.above, {name = fencename, param2 = fdir})
|
||||||
if not homedecor.expect_infinite_stacks then
|
if not homedecor.expect_infinite_stacks then
|
||||||
@ -629,7 +629,7 @@ function homedecor.register_fence_with_sign(fencename, fencewithsignname)
|
|||||||
minetest.pos_to_string(pos)
|
minetest.pos_to_string(pos)
|
||||||
))
|
))
|
||||||
end
|
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)
|
homedecor.update_sign(pos, fields)
|
||||||
end
|
end
|
||||||
def_sign.on_punch = function(pos, node, puncher, ...)
|
def_sign.on_punch = function(pos, node, puncher, ...)
|
||||||
|
Loading…
Reference in New Issue
Block a user