diff --git a/AASBufferFix/AASBufferHelper.cs b/AASBufferFix/AASBufferHelper.cs index ca4f195..d2b3616 100644 --- a/AASBufferFix/AASBufferHelper.cs +++ b/AASBufferFix/AASBufferHelper.cs @@ -33,7 +33,7 @@ public class AASBufferHelper : MonoBehaviour GameHandlesAAS = true; return; } - + //check if avatar uses Avatar Advanced Settings ///SendDebug("[OnInit] Remote avatar initialized. Checking for AAS..."); CVRAvatar avatar = animator.GetComponent(); diff --git a/AASBufferFix/HarmonyPatches.cs b/AASBufferFix/HarmonyPatches.cs index 48ae52d..e81b2cb 100644 --- a/AASBufferFix/HarmonyPatches.cs +++ b/AASBufferFix/HarmonyPatches.cs @@ -24,7 +24,7 @@ internal class HarmonyPatches externalBuffer?.OnAvatarInstantiated(____animator); } - + [HarmonyPostfix] [HarmonyPatch(typeof(PuppetMaster), "AvatarDestroyed")] private static void Postfix_PuppetMaster_AvatarDestroyed(ref PuppetMaster __instance) diff --git a/AASBufferFix/Utils.cs b/AASBufferFix/Utils.cs index bde06f5..2c19000 100644 --- a/AASBufferFix/Utils.cs +++ b/AASBufferFix/Utils.cs @@ -1,5 +1,4 @@ -using MelonLoader; -using UnityEngine; +using UnityEngine; namespace NAK.AASBufferFix; @@ -14,7 +13,11 @@ public class Utils foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters) { - if (animatorControllerParameter.name.Length > 0 && animatorControllerParameter.name[0] != '#' && !coreParameters.Contains(animatorControllerParameter.name) && bitCount <= 3200) + // Do not count above bit limit + if (!(bitCount <= 3200)) + break; + + if (animatorControllerParameter.name.Length > 0 && animatorControllerParameter.name[0] != '#' && !coreParameters.Contains(animatorControllerParameter.name)) { AnimatorControllerParameterType type = animatorControllerParameter.type; switch (type)