fix(wom): fromM2 sets version=3 when batches were extracted

Without this fromM2 always wrote version=2 even when batches were
populated, causing the version field on the in-memory model to lie
about its content. The save() magic-byte selection happens off the
batches/animation flags directly so the on-disk file is still correct,
but loaders that key off model.version saw stale info.
This commit is contained in:
Kelsi 2026-05-06 01:36:37 -07:00
parent 9eae67d574
commit 23951d4075

View file

@ -390,7 +390,10 @@ WoweeModel WoweeModelLoader::fromM2(const std::string& m2Path, AssetManager* am)
if (anim.durationMs > 0) model.animations.push_back(anim);
}
model.version = model.hasAnimation() ? 2 : 1;
// Version reflects highest feature in use: WOM3 if multi-batch, WOM2 if
// animated, WOM1 if just static geometry. The save() function picks magic
// off this same hierarchy.
model.version = model.hasBatches() ? 3 : (model.hasAnimation() ? 2 : 1);
return model;
}