From fbac3241ece9246e6a00455de425e5ecf65d9203 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 31 Mar 2026 04:45:00 -0500 Subject: [PATCH] Update dZoneManager/dZoneManager.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dZoneManager/dZoneManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dZoneManager/dZoneManager.cpp b/dZoneManager/dZoneManager.cpp index 0483e6da..29bf85f0 100644 --- a/dZoneManager/dZoneManager.cpp +++ b/dZoneManager/dZoneManager.cpp @@ -349,9 +349,10 @@ LWOSCENEID dZoneManager::GetSceneIDFromPosition(const NiPoint3& position) const // Scene map uses the same indexing pattern as heightmap: row * width + col const uint32_t sceneIndex = sceneI * chunk.colorMapResolution + sceneJ; - // Bounds check + // Bounds check: if this chunk's sceneMap is inconsistent, skip this chunk if (sceneIndex >= chunk.sceneMap.size()) { - return LWOSCENEID_INVALID; + LOG_DEBUG("GetSceneIDFromPosition: sceneIndex %u out of bounds (sceneMap size: %zu), skipping malformed chunk.", sceneIndex, chunk.sceneMap.size()); + continue; } // Get scene ID from sceneMap