From 9a297308dbb5544c63dfcd345aa48b79673f8d56 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 16 Mar 2025 20:51:44 -0700 Subject: [PATCH] don't use manhattanDistWrapped to prevent boat from starting on opposite side of world --- src/core/Util.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/core/Util.ts b/src/core/Util.ts index 866890b8f..438da4988 100644 --- a/src/core/Util.ts +++ b/src/core/Util.ts @@ -100,16 +100,8 @@ export function closestShoreFromPlayer( } return shoreTiles.reduce((closest, current) => { - const closestDistance = manhattanDistWrapped( - gm.cell(target), - gm.cell(closest), - gm.width(), - ); - const currentDistance = manhattanDistWrapped( - gm.cell(target), - gm.cell(current), - gm.width(), - ); + const closestDistance = gm.manhattanDist(target, closest); + const currentDistance = gm.manhattanDist(target, current); return currentDistance < closestDistance ? current : closest; }); }