Skip to content

Commit

Permalink
honor stopOnWater user parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
IR0NSIGHT committed Aug 20, 2023
1 parent 289eff7 commit bcd4700
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pathing/river.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bcd4700

Please sign in to comment.