Fix mesh artifacts on vanilla/TBC M2 models when using expansion overlays

Vanilla (v256) and TBC (v263) M2 files embed skin data directly, parsed
during M2Loader::load(). The code unconditionally loaded external .skin
files afterwards, which resolved to WotLK-format .skin files (48-byte
submeshes) from the base manifest — overwriting the correctly parsed
embedded skin (32-byte submeshes) and causing mesh corruption on all
character models. Guard all 13 loadSkin() call sites with version >= 264
so external .skin files are only loaded for WotLK M2s that need them.
This commit is contained in:
Kelsi 2026-02-14 13:57:54 -08:00
parent a67dca5787
commit ca3150e43d
3 changed files with 19 additions and 19 deletions

View file

@ -135,10 +135,10 @@ bool CharacterPreview::loadCharacter(game::Race race, game::Gender gender,
auto model = pipeline::M2Loader::load(m2Data);
// Load skin file
// Load skin file (only for WotLK M2s - vanilla has embedded skin)
std::string skinPath = modelDir + baseName + "00.skin";
auto skinData = assetManager_->readFile(skinPath);
if (!skinData.empty()) {
if (!skinData.empty() && model.version >= 264) {
pipeline::M2Loader::loadSkin(skinData, model);
}