mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[AASBufferFix] Fix error when animator is null
This commit is contained in:
parent
6e262bac1b
commit
d04f505d88
5 changed files with 16 additions and 9 deletions
|
@ -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<CVRAvatar>();
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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";
|
||||
}
|
|
@ -20,8 +20,6 @@ public class Utils
|
|||
case AnimatorControllerParameterType.Float:
|
||||
avatarFloatCount++;
|
||||
break;
|
||||
case (AnimatorControllerParameterType)2:
|
||||
break;
|
||||
case AnimatorControllerParameterType.Int:
|
||||
avatarIntCount++;
|
||||
break;
|
||||
|
|
|
@ -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"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue