[AASBufferFix] Fix error when animator is null

This commit is contained in:
NotAKidoS 2023-06-06 10:52:39 -05:00
parent 6e262bac1b
commit d04f505d88
5 changed files with 16 additions and 9 deletions

View file

@ -21,15 +21,17 @@ internal class HarmonyPatches
private static void Postfix_PuppetMaster_AvatarInstantiated(ref PuppetMaster __instance, ref Animator ____animator)
{
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
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<AASBufferHelper>();
if (externalBuffer != null) externalBuffer.OnAvatarDestroyed();
externalBuffer?.OnAvatarDestroyed();
}
[HarmonyPrefix]