mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
check lakes before depressiong fill
This commit is contained in:
parent
e7cf6e4f5a
commit
234814ee56
3 changed files with 39 additions and 3 deletions
3
main.js
3
main.js
|
|
@ -795,11 +795,11 @@ function addLakesInDeepDepressions() {
|
|||
|
||||
for (const n of c[q]) {
|
||||
if (checked[n]) continue;
|
||||
if (h[n] >= treshold) continue;
|
||||
if (h[n] < 20) {
|
||||
deep = false;
|
||||
break;
|
||||
}
|
||||
if (h[n] >= treshold) continue;
|
||||
|
||||
checked[n] = true;
|
||||
queue.push(n);
|
||||
|
|
@ -808,7 +808,6 @@ function addLakesInDeepDepressions() {
|
|||
|
||||
// if not, add a lake
|
||||
if (deep) {
|
||||
debug.append("circle").attr("cx", points[i][0]).attr("cy", points[i][1]).attr("r", 1).attr("fill", "red");
|
||||
const lakeCells = [i].concat(c[i].filter(n => h[n] === h[i]));
|
||||
addLake(lakeCells);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue