From 00a60eba1708d2d289bd0fefc69dff1b920fe0c2 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 30 May 2021 00:04:01 +0100 Subject: [PATCH] =?UTF-8?q?//erode=20=E2=86=92=20river:=20Change=20only=20?= =?UTF-8?q?1=20height=20at=20a=20time=20for=20extra=20granularity=20this?= =?UTF-8?q?=20also=20simplifies=20it=20a=20bit=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldeditadditions/lib/erode/river.lua | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/worldeditadditions/lib/erode/river.lua b/worldeditadditions/lib/erode/river.lua index aa788fb..790d005 100644 --- a/worldeditadditions/lib/erode/river.lua +++ b/worldeditadditions/lib/erode/river.lua @@ -76,18 +76,10 @@ function worldeditadditions.erode.river(heightmap_initial, heightmap, heightmap_ end if action == "fill" then - local above_us = wea.table_filter(adjacent_heights, - function(height) return height > thisheight end - ) - local above_us_next = wea.min(above_us) - heightmap[hi] = above_us_next + heightmap[hi] = heightmap[hi] + 1 filled = filled + 1 elseif action == "remove" then - local below_us = wea.table_filter(adjacent_heights, - function(height) return height < thisheight end - ) - local below_us_next = wea.max(below_us) - heightmap[hi] = below_us_next + heightmap[hi] = heightmap[hi] - 1 removed = removed + 1 end end