mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-23 04:21:24 +01:00
Merge branch 'Azgaar:master' into master
This commit is contained in:
commit
b952376547
5 changed files with 55 additions and 39 deletions
|
|
@ -1502,6 +1502,12 @@ function drawRivers() {
|
|||
|
||||
const riverPaths = pack.rivers.map(({cells, points, i, widthFactor, sourceWidth}) => {
|
||||
if (!cells || cells.length < 2) return;
|
||||
|
||||
if (points && points.length !== cells.length) {
|
||||
console.error(`River ${i} has ${cells.length} cells, but only ${points.length} points defined. Resetting points data`);
|
||||
points = undefined;
|
||||
}
|
||||
|
||||
const meanderedPoints = addMeandering(cells, points);
|
||||
const path = getRiverPath(meanderedPoints, widthFactor, sourceWidth);
|
||||
return `<path id="river${i}" d="${path}"/>`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue