From 1dad5d6415e54eebe46cc5054d8ab2d4221a90f1 Mon Sep 17 00:00:00 2001 From: SDraw Date: Fri, 3 Mar 2023 23:30:14 +0300 Subject: [PATCH] Animator state check --- ml_amt/Main.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ml_amt/Main.cs b/ml_amt/Main.cs index 3999cb9..05ecf6b 100644 --- a/ml_amt/Main.cs +++ b/ml_amt/Main.cs @@ -256,13 +256,15 @@ namespace ml_amt return false; } - static void OnOverride_Prefix(ref CVRAnimatorManager __instance) + static void OnOverride_Prefix(ref CVRAnimatorManager __instance, ref bool __state) { try { if(Settings.OverrideFix && (__instance.animator != null)) { - __instance.animator.enabled = false; + __state = __instance.animator.enabled; + if(__state) + __instance.animator.enabled = false; __instance.animator.WriteDefaultValues(); } } @@ -271,14 +273,15 @@ namespace ml_amt MelonLoader.MelonLogger.Error(l_exception); } } - static void OnOverride_Postfix(ref CVRAnimatorManager __instance) + static void OnOverride_Postfix(ref CVRAnimatorManager __instance, bool __state) { try { if(Settings.OverrideFix && (__instance.animator != null)) { - __instance.animator.enabled = true; - __instance.animator.Update(0f); + __instance.animator.enabled = __state; + if(__state) + __instance.animator.Update(0f); } } catch(System.Exception l_exception)