fix(add river): get id as the biggest id + 1, not the last id + 1

This commit is contained in:
Azgaar 2023-03-26 14:24:46 +04:00
parent 5ca3ac44a4
commit d48f9b3cab
5 changed files with 51 additions and 13 deletions

View file

@ -626,10 +626,11 @@ function addRiverOnClick() {
getType,
getWidth,
getOffset,
getApproximateLength
getApproximateLength,
getNextId
} = Rivers;
const riverCells = [];
let riverId = rivers.length ? last(rivers).i + 1 : 1;
let riverId = getNextId(rivers);
let parent = riverId;
const initialFlux = grid.cells.prec[cells.g[i]];