mirror of
				https://github.com/FaceDeer/dfcaverns.git
				synced 2025-11-04 10:05:29 +01:00 
			
		
		
		
	reuse chasm's ignore list
This commit is contained in:
		@@ -9,6 +9,10 @@ chasms.register_ignore = function(node_name)
 | 
			
		||||
	ignore[minetest.get_content_id(node_name)] = true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
chasms.ignore_content_id = function(content_id)
 | 
			
		||||
	return ignore[content_id]
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local maxy = tonumber(minetest.settings:get("chasms_maxy")) or -50
 | 
			
		||||
local miny = tonumber(minetest.settings:get("chasms_miny")) or -2500
 | 
			
		||||
local falloff = tonumber(minetest.settings:get("chasms_falloff")) or 100
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,13 @@ if minetest.get_modpath("default") then
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local ignore
 | 
			
		||||
if minetest.get_modpath("chasms") then
 | 
			
		||||
	-- the chasms mod already sets up a method to allow chasms to avoid overwriting stalactites and whatnot,
 | 
			
		||||
	-- hijack that.
 | 
			
		||||
	ignore = chasms.ignore_content_id
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local water_level = tonumber(minetest.get_mapgen_setting("water_level"))
 | 
			
		||||
local mapgen_seed = tonumber(minetest.get_mapgen_setting("seed")) % 2^16
 | 
			
		||||
 | 
			
		||||
@@ -114,14 +121,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
 | 
			
		||||
	local nvals_perlin = mapgen_helper.perlin3d("pit_caves:pit", emin, emax, perlin_params)
 | 
			
		||||
		
 | 
			
		||||
	for vi, x, y, z in area:iterp_xyz(emin, emax) do
 | 
			
		||||
		if not (ignore and ignore(data[vi])) then
 | 
			
		||||
			local distance_perturbation = (nvals_perlin[vi]+1)*10
 | 
			
		||||
			local distance = vector.distance({x=x, y=y, z=z}, {x=location_x, y=y, z=location_z}) - distance_perturbation
 | 
			
		||||
			local taper_min = top - 40
 | 
			
		||||
 | 
			
		||||
			if y < top and y > depth then
 | 
			
		||||
		
 | 
			
		||||
			-- taper the top end
 | 
			
		||||
				if y > top - 40 then
 | 
			
		||||
					-- taper the top end
 | 
			
		||||
					distance = distance - ((taper_min - y)/2)
 | 
			
		||||
				end
 | 
			
		||||
			
 | 
			
		||||
@@ -134,6 +141,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	--send data back to voxelmanip
 | 
			
		||||
	vm:set_data(data)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
name = pit_caves
 | 
			
		||||
description = Inserts very tall "pit" caves underground
 | 
			
		||||
depends =
 | 
			
		||||
optional_depends = mapgen_helper, default
 | 
			
		||||
optional_depends = mapgen_helper, default, chasms
 | 
			
		||||
		Reference in New Issue
	
	Block a user