fix for overgen crash in level 2

This commit is contained in:
FaceDeer 2019-11-11 15:23:41 -07:00
parent cc30f96d52
commit ce5c6f807d

View File

@ -141,7 +141,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data)
for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do
local cave_val = nvals_cave[vi] local cave_val = nvals_cave[vi]
if cave_val < -flooding_threshold then if cave_val < -flooding_threshold then
if mapgen_helper.is_pos_within_box({x=x, y=y, z=z}, minp, maxp) then
local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d])
local cave_threshold = cavern_def.cave_threshold local cave_threshold = cavern_def.cave_threshold
@ -156,6 +156,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data)
data[vi] = c_veinstone data[vi] = c_veinstone
end end
end end
end
if data[vi] == c_air and y <= subsea_level then if data[vi] == c_air and y <= subsea_level then
data[vi] = c_water -- otherwise, fill air with water when below sea level data[vi] = c_water -- otherwise, fill air with water when below sea level
end end