mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:30:43 +00:00
don't use manhattanDistWrapped to prevent boat from starting on opposite side of world
This commit is contained in:
+2
-10
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user