river edit: allow to add interim points

This commit is contained in:
Azgaar 2021-08-24 22:24:33 +03:00
parent c1533c5408
commit 008aea2b2f
3 changed files with 58 additions and 39 deletions

View file

@ -319,9 +319,10 @@ window.Rivers = (function () {
};
const getRiverPoints = (riverCells, riverPoints) => {
if (riverPoints) return riverPoints;
const {p} = pack.cells;
return riverCells.map((cell, i) => {
if (riverPoints && riverPoints[i]) return riverPoints[i];
if (cell === -1) return getBorderPoint(riverCells[i - 1]);
return p[cell];
});