From ba017193db450d38390d849f97d518919b483e39 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 07:57:19 -0700 Subject: [PATCH] fix(viewport): skip NPCs with NaN position in marker update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same defensive pattern as updateObjectMarkers — non-finite NPC position would produce NaN vertex positions and Vulkan would drop the entire NPC marker batch, hiding every NPC marker in the zone. --- tools/editor/editor_viewport.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/editor/editor_viewport.cpp b/tools/editor/editor_viewport.cpp index 8bac465c..c2d4be9d 100644 --- a/tools/editor/editor_viewport.cpp +++ b/tools/editor/editor_viewport.cpp @@ -583,6 +583,10 @@ void EditorViewport::updateNpcMarkers(const std::vector& npcs) { struct MV { float pos[3]; float color[4]; }; std::vector verts; for (const auto& npc : npcs) { + // Skip NPCs with non-finite position — would produce NaN vertices + // in the marker mesh (Vulkan validation drops the whole batch). + if (!std::isfinite(npc.position.x) || !std::isfinite(npc.position.y) || + !std::isfinite(npc.position.z)) continue; // Selected NPC: larger marker in cyan-yellow so it pops out among // hostile/friendly markers without losing the hostile colour signal. float s = npc.selected ? 2.5f : 1.5f;