From b04c0e8c71056e215a2081d6d8e521ac3bfd8a75 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 18 Aug 2019 21:03:51 -0600 Subject: [PATCH] allow caravan to appear in area with buildable_to, not just air --- default_markets.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/default_markets.lua b/default_markets.lua index 830bf6e..430aca8 100644 --- a/default_markets.lua +++ b/default_markets.lua @@ -302,12 +302,13 @@ local is_suitable_caravan_space = function(pos, facedir) if node_def == nil or node_def.walkable ~= true then return false end end end - -- air in the rest? + -- buildable_to in the rest? for y = pos.y, pos.y+2, 1 do for x = pos.x - x_dim, pos.x + x_dim, 1 do for z = pos.z - z_dim, pos.z + z_dim, 1 do local node = minetest.get_node({x=x, y=y, z=z}) - if node.name ~= "air" then return false end + local node_def = minetest.registered_nodes[node.name] + if node_def == nil or node_def.buildable_to ~= true then return false end end end end