[F] Practice mode crash on AdvDemoProcess
Build AquaMai / build (push) Has been cancelled Details

pull/84/head
Clansty 2024-11-06 13:58:07 +08:00
parent 1542f3811d
commit 478db15211
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
1 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,7 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using System.Reflection; using System.Reflection;
using AquaMai.Fix; using AquaMai.Fix;
using AquaMai.Helpers; using AquaMai.Helpers;
@ -9,6 +10,7 @@ using AquaMai.Resources;
using AquaMai.Utils; using AquaMai.Utils;
using HarmonyLib; using HarmonyLib;
using Manager; using Manager;
using MelonLoader;
using Monitor; using Monitor;
using Monitor.Game; using Monitor.Game;
using Process; using Process;
@ -200,6 +202,13 @@ public class PractiseMode
[HarmonyPrefix] [HarmonyPrefix]
public static bool NotesManagerPostUpdateTimer(bool ____isPlaying, Stopwatch ____stopwatch, ref float ____curMSec, ref float ____curMSecPre, float ____msecStartGap) 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) if (startGap != -1f)
{ {
____curMSec = startGap; ____curMSec = startGap;