walltool: optimize placement

This commit is contained in:
cora 2021-08-31 21:57:53 +02:00
parent b097b98be4
commit 3ca52fb0c0

View File

@ -152,18 +152,17 @@ scaffold.register_template_scaffold("WallTool", "scaffold_walltool", function(po
local i=1 local i=1
local nds=minetest.find_nodes_near(lp,10,{'air'}) local nds=minetest.find_nodes_near(lp,10,{'air'})
for k,vv in pairs(nds) do for k,vv in pairs(nds) do
if i > 8 then return end
local iwn=iwall_node(vv) local iwn=iwall_node(vv)
local nd=minetest.get_node_or_nil(vv)
if vv and in_wall(vv) then if vv and in_wall(vv) then
if i > 8 then return end
i = i + 1 i = i + 1
local nd=minetest.get_node_or_nil(vv)
if nd and nd.name ~= 'air' then if nd and nd.name ~= 'air' then
scaffold.dig(vv) scaffold.dig(vv)
else else
ws.place(vv,{cobble}) ws.place(vv,{cobble})
end end
elseif vv and iwn then elseif vv and iwn then
if i > 8 then return end
i = i + 1 i = i + 1
if nd and nd.name ~= iwn and nd.name ~= 'air' then if nd and nd.name ~= iwn and nd.name ~= 'air' then
ws.dig(vv) ws.dig(vv)