Fix igloo hidden trapdoor with minetest.after(), https://git.minetest.land/MineClone2/MineClone2/issues/1797

kay27 2021-06-22 16:53:55 +04:00
parent c6b662ce7a
commit 7ff476b9b9

@ -187,8 +187,6 @@ function mcl_structures.generate_igloo(pos, rotation, pr)
if real_depth <= 6 then
return success
end
-- Place hidden trapdoor
minetest.set_node(tpos, {name="mcl_doors:trapdoor", param2=20+minetest.dir_to_facedir(dir)}) -- TODO: more reliable param2
-- Generate ladder to basement
for y=1, real_depth-1 do
set_brick({x=tpos.x-1,y=tpos.y-y,z=tpos.z })
@ -199,6 +197,10 @@ function mcl_structures.generate_igloo(pos, rotation, pr)
end
-- Place basement
mcl_structures.generate_igloo_basement(bpos, rotation, pr)
-- Place hidden trapdoor
minetest.after(5, function(tpos, dir)
minetest.set_node(tpos, {name="mcl_doors:trapdoor", param2=20+minetest.dir_to_facedir(dir)}) -- TODO: more reliable param2
end, tpos, dir)
end
return success
end