From 23951d4075b6daf1b166737cdf3805d97a578061 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 01:36:37 -0700 Subject: [PATCH] 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. --- src/pipeline/wowee_model.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pipeline/wowee_model.cpp b/src/pipeline/wowee_model.cpp index c9978fd2..034edfda 100644 --- a/src/pipeline/wowee_model.cpp +++ b/src/pipeline/wowee_model.cpp @@ -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; }