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 16d998ddc..b1f0a9462 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 @@ -87,17 +87,24 @@ public class LodQuadTree extends QuadTree implements AutoClose } private void updateAllRenderSections(DhBlockPos2D playerPos) { - // reload any sections that need reloading + // reload any sections that need it DhSectionPos[] reloadSectionArray = this.sectionsToReload.keySet().toArray(new DhSectionPos[0]); this.sectionsToReload.clear(); for (DhSectionPos pos : reloadSectionArray) { try { - LodRenderSection renderSection = this.getValue(pos); - if (renderSection != null) + // 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) { - renderSection.reload(this.renderSourceProvider); + 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 */ }