From 1dc3bc28890c546ee9b0127bf4886c381208d5c1 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 29 May 2023 12:51:43 -0500 Subject: [PATCH] LodQuadTree reloadPos out of bounds chnage --- .../com/seibel/lod/core/render/LodQuadTree.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/seibel/lod/core/render/LodQuadTree.java b/core/src/main/java/com/seibel/lod/core/render/LodQuadTree.java index b1f0a9462..a4651a112 100644 --- a/core/src/main/java/com/seibel/lod/core/render/LodQuadTree.java +++ b/core/src/main/java/com/seibel/lod/core/render/LodQuadTree.java @@ -92,22 +92,23 @@ public class LodQuadTree extends QuadTree implements AutoClose this.sectionsToReload.clear(); for (DhSectionPos pos : reloadSectionArray) { - try + // walk up the tree until we hit the root node + // this is done so any high detail changes flow up to the lower detail render sections as well + while (pos.sectionDetailLevel <= this.treeMaxDetailLevel) { - // walk up the tree until we hit the root node or a position that is outside the tree - // this is done so any high detail level changes flow up to the lower detail render sections as well - while (pos.sectionDetailLevel <= this.treeMaxDetailLevel) + try { LodRenderSection renderSection = this.getValue(pos); if (renderSection != null) { renderSection.reload(this.renderSourceProvider); } - - pos = pos.getParentPos(); } + catch (IndexOutOfBoundsException e) + { /* the section is now out of bounds, it doesn't need to be reloaded */ } + + pos = pos.getParentPos(); } - catch (IndexOutOfBoundsException e) { /* the section is now out of bounds, it doesn't need to be reloaded */ } } @@ -346,6 +347,7 @@ public class LodQuadTree extends QuadTree implements AutoClose return; } + //LOGGER.info("LodQuadTree reloadPos ["+pos+"]."); this.sectionsToReload.put(pos, true); }