1
0
Fork 0

Add check for presence of minetest.get_node_boxes before attempting sub-node space checks

This commit is contained in:
teknomunk 2024-06-26 15:56:21 -05:00
parent 3338e2f701
commit 45a8f04d3a
1 changed files with 3 additions and 0 deletions

View File

@ -732,6 +732,9 @@ local function has_room(self,pos)
local n = #minetest.find_nodes_in_area(p1,p2,nodes) or 0
if n == ( dx * dz * dz ) then return true end
-- If we don't have an implementation of get_node_boxes, we can't check for sub-node space
if not minetest.get_node_boxes then return false end
-- Make sure the entire volume except for the top level is free before checking the top layer
if dy > 1 then
n = #minetest.find_nodes_in_area(p1, vector.offset(p2, 0, -1, 0), nodes)