From e6c5860cb97c518987ff003ca9aa55b8562ad506 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sat, 29 Oct 2022 16:45:04 +0200 Subject: [PATCH] Minetest: Boxes: Fix walkable/pointable check Bug reported by Gregor Parzefall in https://github.com/appgurueu/modlib/pull/8#issuecomment-1295793962 --- minetest/boxes.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/minetest/boxes.lua b/minetest/boxes.lua index 7595350..f577c9b 100644 --- a/minetest/boxes.lua +++ b/minetest/boxes.lua @@ -11,11 +11,13 @@ local function get_boxes(box_or_boxes) return type(box_or_boxes[1]) == "number" and {box_or_boxes} or box_or_boxes end +local has_boxes_prop = {collision_box = "walkable", selection_box = "pointable"} + --> list of collisionboxes in Minetest format local function get_node_boxes(pos, type) local node = minetest.get_node(pos) local node_def = minetest.registered_nodes[node.name] - if (not node_def) or node_def.walkable == false then + if not node_def or node_def[has_boxes_prop[type]] == false then return {} end local boxes = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}}