mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
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.
This commit is contained in:
parent
27213c1d40
commit
8f3f1b21af
1 changed files with 7 additions and 1 deletions
|
|
@ -6612,7 +6612,7 @@ void Application::spawnOnlinePlayer(uint64_t guid,
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeline::M2Model model = pipeline::M2Loader::load(m2Data);
|
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);
|
LOG_WARNING("spawnOnlinePlayer: failed to parse M2: ", m2Path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -6624,6 +6624,12 @@ void Application::spawnOnlinePlayer(uint64_t guid,
|
||||||
pipeline::M2Loader::loadSkin(skinData, model);
|
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
|
// Load only core external animations (stand/walk/run) to avoid stalls
|
||||||
for (uint32_t si = 0; si < model.sequences.size(); si++) {
|
for (uint32_t si = 0; si < model.sequences.size(); si++) {
|
||||||
if (!(model.sequences[si].flags & 0x20)) {
|
if (!(model.sequences[si].flags & 0x20)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue