diff --git a/mods/lzr_mapgen/mapgen.lua b/mods/lzr_mapgen/mapgen.lua index 19d3d8bd..f2af2e85 100644 --- a/mods/lzr_mapgen/mapgen.lua +++ b/mods/lzr_mapgen/mapgen.lua @@ -345,7 +345,12 @@ local generate_piece = function(minp, maxp, vm, prot_min, prot_max) local bheight = base_heightmap[z-minp.z+1][x-minp.x+1] local theight = result_heightmap[z-minp.z+1][x-minp.x+1] - local dirt = (theight > 2 and theight < hills_thresh and isln_trees[z-minp.z+1][x-minp.x+1] > 0) and c_dirt_l or c_dirt_g + local dirt + if (theight > 2 and theight < hills_thresh and isln_trees[z-minp.z+1][x-minp.x+1] > 0) then + dirt = c_dirt_l + else + dirt = c_dirt_g + end if y < theight then if y <= CAVESTONE_LEVEL then @@ -354,7 +359,15 @@ local generate_piece = function(minp, maxp, vm, prot_min, prot_max) vm_data[vi] = c_stone end elseif y==ceil(theight) then - vm_data[vi]= y < -3 and c_sand_dark or y<4 and c_sand or (y<60-random(3) and dirt or c_snow) + if y < -3 then + vm_data[vi] = c_sand_dark + elseif y < 4 then + vm_data[vi] = c_sand + elseif y < 60 - random(3) then + vm_data[vi] = dirt + else + vm_data[vi] = c_snow + end elseif y <= WATER_LEVEL then vm_data[vi] = c_water -- Calculate lighting manually (see above)