Fix crash et modifications de la génération du terrain

This commit is contained in:
sys4-fr
2018-11-06 16:21:23 +01:00
parent 8f34ce940b
commit df38728f4b
7 changed files with 163 additions and 61 deletions

View File

@ -142,10 +142,10 @@ local function define_contents()
end
local smooth = snow.smooth_biomes
local smooth_rarity_max = mg.smooth_rarity_max
local smooth_rarity_min = mg.smooth_rarity_min
local smooth_rarity_dif = mg.smooth_rarity_dif
local nosmooth_rarity = mg.nosmooth_rarity
local smooth_rarity_max = mg.smooth_rarity_max or 0
local smooth_rarity_min = mg.smooth_rarity_min or 0
local smooth_rarity_dif = mg.smooth_rarity_dif or 0
local nosmooth_rarity = mg.nosmooth_rarity or 0
snow.register_on_configuring(function(name, v)
if name == "debug" then
@ -199,12 +199,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
define_contents()
end
local vm, emin, emax = minetest.get_mapgen_object"voxelmanip"
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
local data = vm:get_data()
local param2s = vm:get_param2_data()
local heightmap = minetest.get_mapgen_object"heightmap"
local heightmap = minetest.get_mapgen_object("heightmap")
local snow_tab,num = {},1
local pines_tab,pnum = {},1
@ -255,7 +255,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
if not in_biome then
if alpine
and test
and test > smooth_rarity_min then
and test > smooth_rarity_min then
-- remove trees near alpine
local ground_y
if data[area:index(x, maxp.y, z)] == c.air then