mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 07:13:45 +01:00
Fix lack of defaults for wallmounted boxes
This commit is contained in:
parent
2425862045
commit
785dcb80f4
@ -52,15 +52,15 @@ local function get_node_boxes(pos, type)
|
|||||||
box[5] = level
|
box[5] = level
|
||||||
end
|
end
|
||||||
elseif box_type == "wallmounted" then
|
elseif box_type == "wallmounted" then
|
||||||
-- TODO complete if only wall_top is given
|
|
||||||
local dir = minetest.wallmounted_to_dir((paramtype2 == "colorwallmounted" and node.param2 % 8 or node.param2) or 0)
|
local dir = minetest.wallmounted_to_dir((paramtype2 == "colorwallmounted" and node.param2 % 8 or node.param2) or 0)
|
||||||
local box
|
local box
|
||||||
|
-- The (undocumented!) node box defaults below are taken from `NodeBox::reset`
|
||||||
if dir.y > 0 then
|
if dir.y > 0 then
|
||||||
box = def_box.wall_top
|
box = def_box.wall_top or {-0.5, 0.5 - 1/16, -0.5, 0.5, 0.5, 0.5}
|
||||||
elseif dir.y < 0 then
|
elseif dir.y < 0 then
|
||||||
box = def_box.wall_bottom
|
box = def_box.wall_bottom or {-0.5, -0.5, -0.5, 0.5, -0.5 + 1/16, 0.5}
|
||||||
else
|
else
|
||||||
box = def_box.wall_side
|
box = def_box.wall_side or {-0.5, -0.5, -0.5, -0.5 + 1/16, 0.5, 0.5}
|
||||||
if dir.z > 0 then
|
if dir.z > 0 then
|
||||||
box = {box[3], box[2], -box[4], box[6], box[5], -box[1]}
|
box = {box[3], box[2], -box[4], box[6], box[5], -box[1]}
|
||||||
elseif dir.z < 0 then
|
elseif dir.z < 0 then
|
||||||
@ -163,4 +163,4 @@ end
|
|||||||
|
|
||||||
function get_node_collisionboxes(pos)
|
function get_node_collisionboxes(pos)
|
||||||
return get_node_boxes(pos, "collision_box")
|
return get_node_boxes(pos, "collision_box")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user