From bcd4700412004f5331dc4ff6d737e1556c2222c8 Mon Sep 17 00:00:00 2001 From: IR0NSIGHT Date: Sun, 20 Aug 2023 17:10:02 +0200 Subject: [PATCH] honor stopOnWater user parameter --- src/pathing/river.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pathing/river.ts b/src/pathing/river.ts index 731deba..a427a17 100644 --- a/src/pathing/river.ts +++ b/src/pathing/river.ts @@ -44,7 +44,7 @@ export const pathRiverFrom = (pos: point, rivers: SeenSet, pondParams: PondGener while (safetyIt < 1000) { safetyIt++; - if (getZ(current) < params.waterLevel || isWater(current)) //base water level reached + if (getZ(current) < params.waterLevel || (params.stopOnWater && isWater(current))) //base water level reached break; let pathToDrop = findClosestDrop(current, getZ(current)); @@ -89,7 +89,7 @@ export const pathRiverFrom = (pos: point, rivers: SeenSet, pondParams: PondGener break; } - if (isWater(point.point)) { + if (params.stopOnWater && isWater(point.point)) { break; } path.push(point);