Skip to content

Commit dcbd2bd

Browse files
authored
Merge pull request #80 from senko-forks/pr-stinky
Unbreaking Senkos (0 vertex meshes) Make loading models not fail if there's 0 vertices in a mesh...
2 parents ca69053 + af2f46c commit dcbd2bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xivModdingFramework/Models/Helpers/ModelModifiers.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ public static void MergeGeometryData(TTModel ttModel, XivMdl rawMdl, Action<bool
440440
uniqueVertexIds.Sort();
441441

442442
// Maps old vertex ID to new vertex ID.
443-
var vertMap = new int[uniqueVertexIds.Max() + 1];
443+
var vertMap = Array.Empty<int>();
444+
if (uniqueVertexIds.Count > 0)
445+
vertMap = new int[uniqueVertexIds.Max() + 1];
444446

445447
// Now we need to loop through, copy over the vertex data, keeping track of the new vertex IDs.
446448
ttPart.Vertices = new List<TTVertex>(uniqueVertexIds.Count);

0 commit comments

Comments
 (0)