From 8f3f1b21af5e9fa6d59f21fa6fb17c1f5e4d72da Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 02:58:42 -0700 Subject: [PATCH] fix: check vertices before skin load so WotLK (v264) character M2s parse correctly TBC races like Draenei use version-264 M2 files with no embedded skin; indices come from a separate .skin file loaded after M2::load(). The premature isValid() check (which requires non-empty indices) always failed for WotLK-format character models, making Draenei (and Blood Elf) players invisible. Fix: only check vertices.empty() right after load(), then validate fully with isValid() after the skin file is loaded. --- src/core/application.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index a65f2135..79bc6c7f 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -6612,7 +6612,7 @@ void Application::spawnOnlinePlayer(uint64_t guid, } pipeline::M2Model model = pipeline::M2Loader::load(m2Data); - if (!model.isValid() || model.vertices.empty()) { + if (model.vertices.empty()) { LOG_WARNING("spawnOnlinePlayer: failed to parse M2: ", m2Path); return; } @@ -6624,6 +6624,12 @@ void Application::spawnOnlinePlayer(uint64_t guid, pipeline::M2Loader::loadSkin(skinData, model); } + // After skin loading, full model must be valid (vertices + indices) + if (!model.isValid()) { + LOG_WARNING("spawnOnlinePlayer: failed to load skin for M2: ", m2Path); + return; + } + // Load only core external animations (stand/walk/run) to avoid stalls for (uint32_t si = 0; si < model.sequences.size(); si++) { if (!(model.sequences[si].flags & 0x20)) {