Fix geoset filtering using correct geosetId from M2 batch

M2 batches have a geosetIndex field that determines the geoset group for
filtering (0-18=body, 1xx=hair, etc.). We were incorrectly using submeshId
from the submesh struct instead. Now properly stores and uses geosetId.
This commit is contained in:
Kelsi 2026-02-05 23:26:30 -08:00
parent 3e50b1071d
commit 45048757ef
3 changed files with 6 additions and 4 deletions

View file

@ -627,6 +627,7 @@ bool M2Loader::loadSkin(const std::vector<uint8_t>& skinData, M2Model& model) {
batch.textureUnit = db.textureCoordIndex;
batch.transparencyIndex = db.textureWeightIndex;
batch.textureAnimIndex = db.textureTransformIndex;
batch.geosetId = db.geosetIndex; // Geoset ID for filtering (from batch, not submesh)
// Look up proper vertex/index ranges from submesh
if (db.skinSectionIndex < submeshes.size()) {