mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-22 19:45:02 +00:00
//erode → river: Change only 1 height at a time for extra granularity
this also simplifies it a bit too
This commit is contained in:
parent
9ecdd01914
commit
00a60eba17
1 changed files with 2 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue