Rewritten part of code to calculate river depth

Fixes bathymetry problems on turns or confluences, as well as abrupt riverbanks.
This commit is contained in:
Gaël de Sailly
2020-04-26 22:19:05 +02:00
parent cd4b517585
commit b429b302e1
2 changed files with 52 additions and 55 deletions

View File

@ -153,17 +153,6 @@ local function make_polygons(minp, maxp)
local river_east = 1 - (dirB==1 and riverB or 0) - (dirC==3 and riverC or 0)
local river_south = 1 - (dirD==2 and riverD or 0) - (dirC==4 and riverC or 0)
-- Only if opposite rivers overlap (should be rare)
if river_west > river_east then
local mean = (river_west + river_east) / 2
river_west = mean
river_east = mean
end
if river_north > river_south then
local mean = (river_north + river_south) / 2
river_north = mean
river_south = mean
end
polygon.rivers = {river_west, river_north, river_east, river_south}
end
end