From 2b5a224de10a1af63af55a112f6eb66d52561d39 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Fri, 14 Nov 2014 00:19:01 +0100 Subject: [PATCH] avoid artefacts where terrain blend encounters deep oceans --- mapgen.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index 7d415be..8fc07aa 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -125,9 +125,13 @@ mg_villages.lower_or_raise_terrain_at_point = function( x, z, target_height, min end y = y-1; end - - if( not( surface_node ) and old_height == maxp.y and data[a:index( x, minp.y, z)]==c_air) then - old_height = vh - 2; + + if( not( surface_node ) and old_height == maxp.y ) then + if( data[a:index( x, minp.y, z)]==c_air) then + old_height = vh - 2; + elseif( minp.y < 0 ) then + old_height = minp.y; + end end if( not( surface_node ) or surface_node == cid.c_dirt) then surface_node = cid.c_dirt_with_grass;