From 396f9a9df2439650ce7b914a0912980ef670a116 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Fri, 4 Aug 2023 20:04:16 -0400 Subject: [PATCH] Fix index out of range error from the skin count > 4 fix --- .../FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs index 9c2c6867..39377e6d 100644 --- a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs +++ b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs @@ -1889,8 +1889,11 @@ namespace Bfres.Structs // Save a v4 set each time v4Index hits 3 (.w) if (v4Index == 3) { - weights[v4ListIndex].Add(vWeight4); - boneInd[v4ListIndex].Add(vBoneInd4); + if (weights.Count > v4ListIndex) + weights[v4ListIndex].Add(vWeight4); + if (weights.Count > v4ListIndex) + boneInd[v4ListIndex].Add(vBoneInd4); + v4ListIndex++; v4Index = 0; continue;