mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fix lake elevation limits
This commit is contained in:
parent
5ed08e156a
commit
f2f170ff29
1 changed files with 3 additions and 3 deletions
|
|
@ -187,8 +187,8 @@
|
||||||
const resolveDepressions = function (h) {
|
const resolveDepressions = function (h) {
|
||||||
const {cells, features} = pack;
|
const {cells, features} = pack;
|
||||||
const maxIterations = +document.getElementById("resolveDepressionsStepsOutput").value;
|
const maxIterations = +document.getElementById("resolveDepressionsStepsOutput").value;
|
||||||
const checkLakeMaxIteration = maxIterations * 0.8;
|
const checkLakeMaxIteration = maxIterations * 0.85;
|
||||||
const elevateLakeMaxIteration = (maxIterations - checkLakeMaxIteration) / 2;
|
const elevateLakeMaxIteration = maxIterations * 0.75;
|
||||||
|
|
||||||
const height = i => features[cells.f[i]].height || h[i]; // height of lake or specific cell
|
const height = i => features[cells.f[i]].height || h[i]; // height of lake or specific cell
|
||||||
|
|
||||||
|
|
@ -215,7 +215,7 @@
|
||||||
const minHeight = d3.min(l.shoreline.map(s => h[s]));
|
const minHeight = d3.min(l.shoreline.map(s => h[s]));
|
||||||
if (minHeight >= 100 || l.height > minHeight) continue;
|
if (minHeight >= 100 || l.height > minHeight) continue;
|
||||||
|
|
||||||
if (iteration < elevateLakeMaxIteration) {
|
if (iteration > elevateLakeMaxIteration) {
|
||||||
l.shoreline.forEach(i => (h[i] = cells.h[i]));
|
l.shoreline.forEach(i => (h[i] = cells.h[i]));
|
||||||
l.height = d3.min(l.shoreline.map(s => h[s])) - 1;
|
l.height = d3.min(l.shoreline.map(s => h[s])) - 1;
|
||||||
l.closed = true;
|
l.closed = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue