From b7ca6dbd8793954199dd85df1a8dfdde8681eaba Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 17 Jun 2023 20:57:41 -0500 Subject: [PATCH] Fix DhLodPos.getDhSectionRelativePositionForDetailLevel() It had an off by 1 error --- .../java/com/seibel/distanthorizons/core/pos/DhLodPos.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java index dce4d5060..e1a21d547 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java @@ -125,8 +125,8 @@ public class DhLodPos implements Comparable int zRelativePos = zInput / BitShiftUtil.powerOfTwo(detailLevelDifference); // convert the positions into section relative space (0-63) - xRelativePos = xInput >= 0 ? (xRelativePos % 64) : 64 + (xRelativePos % 64); - zRelativePos = zInput >= 0 ? (zRelativePos % 64) : 64 + (zRelativePos % 64); + xRelativePos = xInput >= 0 ? (xRelativePos % 64) : 63 + (xRelativePos % 64); + zRelativePos = zInput >= 0 ? (zRelativePos % 64) : 63 + (zRelativePos % 64); return new DhLodPos(outputDetailLevel, xRelativePos, zRelativePos); }