From fc971e49022bb683bd697cab4fe4da91586f5db2 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 19 Mar 2022 20:03:16 +0300 Subject: [PATCH] rivers: if points data is wrong, ignore points --- modules/ui/layers.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ui/layers.js b/modules/ui/layers.js index 653cc9e4..009828c4 100644 --- a/modules/ui/layers.js +++ b/modules/ui/layers.js @@ -1481,6 +1481,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 ``;