diff --git a/AASBufferFix/AASBufferHelper.cs b/AASBufferFix/AASBufferHelper.cs index 78bda22..ca4f195 100644 --- a/AASBufferFix/AASBufferHelper.cs +++ b/AASBufferFix/AASBufferHelper.cs @@ -27,6 +27,13 @@ public class AASBufferHelper : MonoBehaviour public void OnAvatarInstantiated(Animator animator) { + // have never run into an avatar without an animator until today + if (animator == null) + { + 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 4d712e0..48ae52d 100644 --- a/AASBufferFix/HarmonyPatches.cs +++ b/AASBufferFix/HarmonyPatches.cs @@ -21,15 +21,17 @@ internal class HarmonyPatches private static void Postfix_PuppetMaster_AvatarInstantiated(ref PuppetMaster __instance, ref Animator ____animator) { AASBufferHelper externalBuffer = __instance.GetComponent(); - if (externalBuffer != null) externalBuffer.OnAvatarInstantiated(____animator); - } + externalBuffer?.OnAvatarInstantiated(____animator); + } + [HarmonyPostfix] [HarmonyPatch(typeof(PuppetMaster), "AvatarDestroyed")] private static void Postfix_PuppetMaster_AvatarDestroyed(ref PuppetMaster __instance) { AASBufferHelper externalBuffer = __instance.GetComponent(); - if (externalBuffer != null) externalBuffer.OnAvatarDestroyed(); + + externalBuffer?.OnAvatarDestroyed(); } [HarmonyPrefix] diff --git a/AASBufferFix/Properties/AssemblyInfo.cs b/AASBufferFix/Properties/AssemblyInfo.cs index 78f7737..e981f44 100644 --- a/AASBufferFix/Properties/AssemblyInfo.cs +++ b/AASBufferFix/Properties/AssemblyInfo.cs @@ -24,6 +24,6 @@ using System.Reflection; namespace NAK.AASBufferFix.Properties; internal static class AssemblyInfoParams { - public const string Version = "1.0.5"; + public const string Version = "1.0.6"; public const string Author = "NotAKidoS"; } \ No newline at end of file diff --git a/AASBufferFix/Utils.cs b/AASBufferFix/Utils.cs index 3347386..fe2bf81 100644 --- a/AASBufferFix/Utils.cs +++ b/AASBufferFix/Utils.cs @@ -20,8 +20,6 @@ public class Utils case AnimatorControllerParameterType.Float: avatarFloatCount++; break; - case (AnimatorControllerParameterType)2: - break; case AnimatorControllerParameterType.Int: avatarIntCount++; break; diff --git a/AASBufferFix/format.json b/AASBufferFix/format.json index 1311380..76c4955 100644 --- a/AASBufferFix/format.json +++ b/AASBufferFix/format.json @@ -1,7 +1,7 @@ { "_id": 126, "name": "AASBufferFix", - "modversion": "1.0.5", + "modversion": "1.0.6", "gameversion": "2022r170", "loaderversion": "0.5.7", "modtype": "Mod", @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/AASBufferFix.dll", + "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r9/AASBufferFix.dll", "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/AASBufferFix/", - "changelog": "", + "changelog": "Fixed an error when a remote avatar does not have an Animator component.", "embedcolor": "9b59b6" } \ No newline at end of file