mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-01-03 13:30:20 +01:00
add sanity check to avoid cases in which expanded items would be placed against unknown nodes into other unknown nodes as pointed_think.above node
this resolves #205
This commit is contained in:
parent
f96e890155
commit
db703e555d
@ -50,6 +50,8 @@ end
|
|||||||
-- leave the last argument nil if it's one 2m high node
|
-- leave the last argument nil if it's one 2m high node
|
||||||
function homedecor.stack_vertically(itemstack, placer, pointed_thing, node1, node2)
|
function homedecor.stack_vertically(itemstack, placer, pointed_thing, node1, node2)
|
||||||
local pos, def = select_node(pointed_thing)
|
local pos, def = select_node(pointed_thing)
|
||||||
|
if not def then return end -- rare corner case, but happened in #205
|
||||||
|
|
||||||
if def.on_rightclick then
|
if def.on_rightclick then
|
||||||
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
|
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
|
||||||
end
|
end
|
||||||
@ -69,6 +71,8 @@ local fdir_to_left = {
|
|||||||
}
|
}
|
||||||
function homedecor.stack_wing(itemstack, placer, pointed_thing, node1, node2, node1_right, node2_right)
|
function homedecor.stack_wing(itemstack, placer, pointed_thing, node1, node2, node1_right, node2_right)
|
||||||
local pos, def = select_node(pointed_thing)
|
local pos, def = select_node(pointed_thing)
|
||||||
|
if not def then return end -- rare corner case, but happened in #205
|
||||||
|
|
||||||
if def.on_rightclick then
|
if def.on_rightclick then
|
||||||
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
|
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
|
||||||
end
|
end
|
||||||
@ -102,6 +106,8 @@ homedecor.fdir_to_fwd = {
|
|||||||
|
|
||||||
function homedecor.stack_sideways(itemstack, placer, pointed_thing, node1, node2, dir)
|
function homedecor.stack_sideways(itemstack, placer, pointed_thing, node1, node2, dir)
|
||||||
local pos, def = select_node(pointed_thing)
|
local pos, def = select_node(pointed_thing)
|
||||||
|
if not def then return end -- rare corner case, but happened in #205
|
||||||
|
|
||||||
if def.on_rightclick then
|
if def.on_rightclick then
|
||||||
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
|
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user