Don't dig torches into stone
This commit is contained in:
parent
0d9007a33e
commit
b21adb5a39
16
init.lua
16
init.lua
@ -279,12 +279,20 @@ local function corridor_part(start_point, segment_vector, segment_count, wood, p
|
|||||||
local node = {name="default:torch", param2=minetest.dir_to_wallmounted({x=0,y=-1,z=0})}
|
local node = {name="default:torch", param2=minetest.dir_to_wallmounted({x=0,y=-1,z=0})}
|
||||||
|
|
||||||
-- Try two different height levels
|
-- Try two different height levels
|
||||||
if not SetNodeIfCanBuild({x=calc[1], y=p.y-2, z=calc[2]}, node) then
|
local pos1 = {x=calc[1], y=p.y-2, z=calc[2]}
|
||||||
SetNodeIfCanBuild({x=calc[1], y=p.y-1, z=calc[2]}, node)
|
local pos2 = {x=calc[3], y=p.y-2, z=calc[4]}
|
||||||
|
local nodedef1 = minetest.registered_nodes[minetest.get_node(pos1).name]
|
||||||
|
local nodedef2 = minetest.registered_nodes[minetest.get_node(pos2).name]
|
||||||
|
|
||||||
|
if nodedef1.walkable then
|
||||||
|
pos1.y = pos1.y + 1
|
||||||
end
|
end
|
||||||
if not SetNodeIfCanBuild({x=calc[3], y=p.y-2, z=calc[4]}, node) then
|
SetNodeIfCanBuild(pos1, node)
|
||||||
SetNodeIfCanBuild({x=calc[3], y=p.y-1, z=calc[4]}, node)
|
|
||||||
|
if nodedef2.walkable then
|
||||||
|
pos2.y = pos2.y + 1
|
||||||
end
|
end
|
||||||
|
SetNodeIfCanBuild(pos2, node)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user