Skip to content

Commit 4fca246

Browse files
committed
- Don't read shape data of old mods.
1 parent f770bc7 commit 4fca246

File tree

1 file changed

+11
-2
lines changed
  • xivModdingFramework/Models/FileTypes

1 file changed

+11
-2
lines changed

xivModdingFramework/Models/FileTypes/Mdl.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,16 @@ public async Task<XivMdl> GetRawMdlData(string mdlPath, bool getOriginal = false
448448
var index = new Index(_gameDirectory);
449449
var dat = new Dat(_gameDirectory);
450450
var modding = new Modding(_gameDirectory);
451+
var mod = await modding.TryGetModEntry(mdlPath);
452+
var modded = mod != null && mod.enabled;
451453
var getShapeData = true;
452454

453455

454456
var offset = await index.GetDataOffset(mdlPath);
455457

456458
if (getOriginal)
457459
{
458-
var mod = await modding.TryGetModEntry(mdlPath);
459-
if (mod != null && mod.enabled)
460+
if (modded)
460461
{
461462
offset = mod.data.originalOffset;
462463
}
@@ -684,6 +685,13 @@ public async Task<XivMdl> GetRawMdlData(string mdlPath, bool getOriginal = false
684685
lod.MeshCount = 1;
685686
}
686687

688+
// This is a simple check to identify old mods that may have broken shape data.
689+
// Old mods still have LoD 1+ data.
690+
if (modded && i > 0 && lod.MeshCount > 0)
691+
{
692+
getShapeData = false;
693+
}
694+
687695
//Adding to xivMdl
688696
xivMdl.LoDList.Add(lod);
689697
}
@@ -729,6 +737,7 @@ public async Task<XivMdl> GetRawMdlData(string mdlPath, bool getOriginal = false
729737
}
730738
}
731739

740+
732741
// Now that we have the LoD data, we can go back and read the Vertex Data Structures
733742
// First we save our current position
734743
var savePosition = br.BaseStream.Position;

0 commit comments

Comments
 (0)