diff --git a/Portals/format.json b/Portals/format.json new file mode 100644 index 0000000..d3c7457 --- /dev/null +++ b/Portals/format.json @@ -0,0 +1 @@ + "None" diff --git a/VisualCloneFix/Patches.cs b/VisualCloneFix/Patches.cs index 608763a..286b268 100644 --- a/VisualCloneFix/Patches.cs +++ b/VisualCloneFix/Patches.cs @@ -101,10 +101,14 @@ public static class Patches int[] vertexIndices = new int[sharedMesh.vertexCount]; // Pre-map bone transforms to their exclusion ids if applicable - int[] boneIndexToExclusionId = new int[renderer.bones.Length]; - for (int i = 0; i < renderer.bones.Length; i++) - if (exclusions.TryGetValue(renderer.bones[i], out FPRExclusion exclusion)) - boneIndexToExclusionId[i] = ((MeshHiderExclusion)exclusion.behaviour).id; + var bones = renderer.bones; + int[] boneIndexToExclusionId = new int[bones.Length]; + for (int i = 0; i < bones.Length; i++) + { + Transform bone = bones[i]; + if (bone != null && exclusions.TryGetValue(bone, out FPRExclusion exclusion)) + boneIndexToExclusionId[i] = ((MeshHiderExclusion)(exclusion.behaviour)).id; + } const float minWeightThreshold = 0.2f; for (int i = 0; i < boneWeights.Length; i++)