From 5bb33311fba48ed83f797c77779dbb909d6e1958 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Tue, 17 Dec 2024 17:11:13 +0100 Subject: [PATCH] fix: 1.106.7 - rivers starting width calc --- index.html | 2 +- modules/river-generator.js | 5 ++--- versioning.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 755533c0..9d8c9538 100644 --- a/index.html +++ b/index.html @@ -8078,7 +8078,7 @@ - + diff --git a/modules/river-generator.js b/modules/river-generator.js index 9e1f15eb..254e1af8 100644 --- a/modules/river-generator.js +++ b/modules/river-generator.js @@ -196,7 +196,7 @@ window.Rivers = (function () { flux: discharge, pointIndex: meanderedPoints.length, widthFactor, - sourceWidth + startingWidth: sourceWidth }) ); @@ -387,13 +387,12 @@ window.Rivers = (function () { const LENGTH_FACTOR = 200; const LENGTH_STEP_WIDTH = 1 / LENGTH_FACTOR; const LENGTH_PROGRESSION = [1, 1, 2, 3, 5, 8, 13, 21, 34].map(n => n / LENGTH_FACTOR); - const MAX_PROGRESSION = last(LENGTH_PROGRESSION); const getOffset = ({flux, pointIndex, widthFactor, startingWidth}) => { if (pointIndex === 0) return startingWidth; const fluxWidth = Math.min(flux ** 0.7 / FLUX_FACTOR, MAX_FLUX_WIDTH); - const lengthWidth = pointIndex * LENGTH_STEP_WIDTH + (LENGTH_PROGRESSION[pointIndex] || MAX_PROGRESSION); + const lengthWidth = pointIndex * LENGTH_STEP_WIDTH + (LENGTH_PROGRESSION[pointIndex] || LENGTH_PROGRESSION.at(-1)); return widthFactor * (lengthWidth + fluxWidth) + startingWidth; }; diff --git a/versioning.js b/versioning.js index 998a7c19..e12cea06 100644 --- a/versioning.js +++ b/versioning.js @@ -13,7 +13,7 @@ * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.106.6"; +const VERSION = "1.106.7"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); {