mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-02-03 14:00:25 +01:00
overgenerate caverns to eliminate floating stalactites
This commit is contained in:
parent
a9dfec969b
commit
417ab233ac
@ -79,11 +79,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local chasm_area = VoxelArea:new{MinEdge = vector.subtract(emin, waver_vector), MaxEdge = vector.add(emax, waver_vector)}
|
local chasm_area = VoxelArea:new{MinEdge = vector.subtract(emin, waver_vector), MaxEdge = vector.add(emax, waver_vector)}
|
||||||
local data_area = VoxelArea:new{MinEdge = emin, MaxEdge = emax}
|
local data_area = VoxelArea:new{MinEdge = emin, MaxEdge = emax}
|
||||||
|
|
||||||
-- local count = {}
|
for i, x, y, z in data_area:iterp_xyz(emin, emax) do
|
||||||
|
|
||||||
for i, x, y, z in data_area:iterp_xyz(minp, maxp) do
|
|
||||||
local waver = math.min(math.max(math.floor(waver_data[i]+0.5), -waver_strength), waver_strength)
|
local waver = math.min(math.max(math.floor(waver_data[i]+0.5), -waver_strength), waver_strength)
|
||||||
-- count[waver] = (count[waver] or 0) + 1
|
|
||||||
local intensity = get_intensity(y)
|
local intensity = get_intensity(y)
|
||||||
if chasm_data[chasm_area:index(x+waver, y, z)]*intensity > chasms_threshold then
|
if chasm_data[chasm_area:index(x+waver, y, z)]*intensity > chasms_threshold then
|
||||||
data[i] = c_air
|
data[i] = c_air
|
||||||
@ -92,6 +89,4 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
vm:set_data(data)
|
vm:set_data(data)
|
||||||
vm:calc_lighting()
|
vm:calc_lighting()
|
||||||
vm:write_to_map()
|
vm:write_to_map()
|
||||||
|
|
||||||
-- minetest.debug(dump(count))
|
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user