From 1d42d1d73952d51f6ac66ccb04b64096e6334745 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Fri, 17 Jul 2015 20:21:56 +0200 Subject: [PATCH] :cat2: --- mapgen.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index 9b679a8..29942f1 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -138,6 +138,9 @@ minetest.register_on_generated(function(minp, maxp, seed) local tab = {} pr = PseudoRandom(seed+68) + local heightmap = minetest.get_mapgen_object("heightmap") + local hmi = 1 + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") data = vm:get_data() area = VoxelArea:new{MinEdge=emin, MaxEdge=emax} @@ -181,11 +184,11 @@ minetest.register_on_generated(function(minp, maxp, seed) if in_biome then - local ymin = math.max(1, minp.y) -- -1 + local ymin = math.max(heightmap[hmi]-5, minp.y) -- -1 -- skip the air part local ground - for y = maxp.y,ymin,-1 do + for y = math.min(heightmap[hmi]+20, maxp.y),ymin,-1 do if data[area:index(x, y, z)] ~= c.air then ground = y break @@ -255,6 +258,7 @@ minetest.register_on_generated(function(minp, maxp, seed) end end end + hmi = hmi+1 end end riesenpilz.inform("ground finished", 2, t1)