From 785dcb80f4a81ca32fbda129716501ebdf6b675e Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sat, 1 Apr 2023 11:29:23 +0200 Subject: [PATCH] Fix lack of defaults for wallmounted boxes --- minetest/boxes.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/minetest/boxes.lua b/minetest/boxes.lua index 5d5a288..4c193a6 100644 --- a/minetest/boxes.lua +++ b/minetest/boxes.lua @@ -52,15 +52,15 @@ local function get_node_boxes(pos, type) box[5] = level end 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 box + -- The (undocumented!) node box defaults below are taken from `NodeBox::reset` 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 - 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 - 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 box = {box[3], box[2], -box[4], box[6], box[5], -box[1]} elseif dir.z < 0 then @@ -163,4 +163,4 @@ end function get_node_collisionboxes(pos) return get_node_boxes(pos, "collision_box") -end \ No newline at end of file +end