From 478db15211d2023b2c24860baab1ae771926ba8e Mon Sep 17 00:00:00 2001 From: Clansty Date: Wed, 6 Nov 2024 13:58:07 +0800 Subject: [PATCH] [F] Practice mode crash on AdvDemoProcess --- AquaMai/ModKeyMap/PractiseMode.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AquaMai/ModKeyMap/PractiseMode.cs b/AquaMai/ModKeyMap/PractiseMode.cs index 761243ad..00edfd02 100644 --- a/AquaMai/ModKeyMap/PractiseMode.cs +++ b/AquaMai/ModKeyMap/PractiseMode.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Reflection; using AquaMai.Fix; using AquaMai.Helpers; @@ -9,6 +10,7 @@ using AquaMai.Resources; using AquaMai.Utils; using HarmonyLib; using Manager; +using MelonLoader; using Monitor; using Monitor.Game; using Process; @@ -200,6 +202,13 @@ public class PractiseMode [HarmonyPrefix] public static bool NotesManagerPostUpdateTimer(bool ____isPlaying, Stopwatch ____stopwatch, ref float ____curMSec, ref float ____curMSecPre, float ____msecStartGap) { + var stackTrace = new StackTrace(); // get call stack + var stackFrames = stackTrace.GetFrames(); // get method calls (frames) + if(stackFrames.Select(it => it.GetMethod().DeclaringType.Name).Contains("AdvDemoProcess")) + { + return true; + } + if (startGap != -1f) { ____curMSec = startGap;