Skip to content

Commit beef0d9

Browse files
Put out more neck related fires
1 parent af2f46c commit beef0d9

File tree

1 file changed

+8
-3
lines changed
  • xivModdingFramework/Models/FileTypes

1 file changed

+8
-3
lines changed

xivModdingFramework/Models/FileTypes/Mdl.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,9 +1004,10 @@ public static XivMdl GetXivMdl(byte[] mdlData, string mdlPath = "")
10041004
}
10051005
}
10061006
else {
1007-
if (xivMdl.LoDList[0].VertexDataOffset < br.BaseStream.Position
1008-
|| (xivMdl.LoDList[0].VertexDataOffset % 8 != br.BaseStream.Position % 8)
1009-
&& xivMdl.LoDList[1].VertexDataSize == 0)
1007+
if ((xivMdl.LoDList[0].VertexDataOffset < br.BaseStream.Position
1008+
|| (xivMdl.LoDList[0].VertexDataOffset % 8 != br.BaseStream.Position % 8))
1009+
&& xivMdl.LoDList[1].VertexDataSize == 0 // Avoid applying this fix to vanilla models
1010+
&& xivMdl.ModelData.NeckMorphTableSize != 0x0A) // Avoid applying to face models, which were written incorrectly after patch 7.1
10101011
{
10111012

10121013
var delta = (int)(xivMdl.LoDList[0].VertexDataOffset - br.BaseStream.Position);
@@ -3608,6 +3609,10 @@ public static byte[] MakeUncompressedMdlFile(TTModel ttModel, XivMdl ogMdl, Acti
36083609
bones.Add((byte)boneset0Index);
36093610
}
36103611

3612+
// Fully abort building neck data if we gave up inside the previous loop
3613+
if (basicModelBlock[neckMorphTableSizePointer] == 0)
3614+
break;
3615+
36113616
// Serialize
36123617
neckMorphDataBlock.AddRange(BitConverter.GetBytes(positionAdjust.X));
36133618
neckMorphDataBlock.AddRange(BitConverter.GetBytes(positionAdjust.Y));

0 commit comments

Comments
 (0)