From 25705c730e5c0741e4f4f788d9e4a4ecdf62e656 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sat, 16 Nov 2019 17:04:52 -0500 Subject: [PATCH] GFBMDL : Add better bone index check --- File_Format_Library/FileFormats/GFBMDL/GFBMDL.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/File_Format_Library/FileFormats/GFBMDL/GFBMDL.cs b/File_Format_Library/FileFormats/GFBMDL/GFBMDL.cs index 82e2a119..648a0c6e 100644 --- a/File_Format_Library/FileFormats/GFBMDL/GFBMDL.cs +++ b/File_Format_Library/FileFormats/GFBMDL/GFBMDL.cs @@ -319,7 +319,10 @@ namespace FirstPlugin mesh.ImageKey = "model"; mesh.SelectedImageKey = "model"; - mesh.BoneIndex = (int)VisualGroups[i].BoneIndex; + int boneIndex = (int)VisualGroups[i].BoneIndex; + if (boneIndex < Skeleton.bones.Count && boneIndex > 0 && ((Bone)Skeleton.bones[boneIndex]).HasSkinning) + mesh.BoneIndex = boneIndex; + mesh.Text = Skeleton.bones[(int)VisualGroups[i].MeshIndex].Text; Root.Renderer.Meshes.Add(mesh);