1
0
mirror of synced 2024-11-28 01:10:51 +01:00

GFBMDL : Add better bone index check

This commit is contained in:
KillzXGaming 2019-11-16 17:04:52 -05:00
parent 2030582de2
commit 25705c730e

View File

@ -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);