Improve DhLodPos.getWidthAtDetail assertion

This commit is contained in:
James Seibel
2024-03-21 18:12:37 -05:00
parent f11e9a142f
commit f3d8a749fd
@@ -72,7 +72,11 @@ public class DhLodPos implements Comparable<DhLodPos>
// Get the width of this pos, measured in the target detail level.
public int getWidthAtDetail(byte targetLevel)
{
LodUtil.assertTrue(targetLevel <= this.detailLevel);
if (targetLevel > this.detailLevel)
{
LodUtil.assertNotReach("getWidthAtDetail for pos "+this+", given target detail level of bounds: ["+targetLevel+"], this: ["+this.detailLevel+"]");
}
return BitShiftUtil.powerOfTwo(this.detailLevel - targetLevel);
}