mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-08 01:53:52 +00:00
fix(viewport): skip NPCs with NaN position in marker update
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.
This commit is contained in:
parent
b1cfef8264
commit
ba017193db
1 changed files with 4 additions and 0 deletions
|
|
@ -583,6 +583,10 @@ void EditorViewport::updateNpcMarkers(const std::vector<CreatureSpawn>& npcs) {
|
|||
struct MV { float pos[3]; float color[4]; };
|
||||
std::vector<MV> 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue