fix: add rivers when rivers array is empty

This commit is contained in:
Azgaar 2021-08-01 13:31:54 +03:00
parent f57a72d764
commit 078b83633f
2 changed files with 2 additions and 2 deletions

View file

@ -539,7 +539,7 @@ function addRiverOnClick() {
const {alterHeights, resolveDepressions, addMeandering, getRiverPath, getBasin, getName, getType, getWidth, getOffset, getApproximateLength} = Rivers;
const riverCells = [];
let riverId = last(rivers).i + 1;
let riverId = rivers.length ? last(rivers).i + 1 : 1;
let parent = riverId;
const initialFlux = grid.cells.prec[cells.g[i]];