From 24006156942162bb27bf8c6e2d009c754170e901 Mon Sep 17 00:00:00 2001 From: Cheneeey <45511797+Cheney0120@users.noreply.github.com> Date: Fri, 9 Aug 2024 22:21:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复幻海导致计时不显示的bug(#11),以及非钓鱼状态cpu占用过高的问题 * 1.修改为在幻海以及特殊天气时,取消钓鱼不会重置天气倒计时,并且保持显示 2.修复在非钓鱼状态cpu占用过高的问题 3.修复启动时因死循环问题导致的无法使用 --- .../MainWindow.xaml.cs" | 12 +++++++----- .../Models/Fish.cs" | 2 +- .../Models/SigScanner.cs" | 4 +--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git "a/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/MainWindow.xaml.cs" "b/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/MainWindow.xaml.cs" index 2f5cbe5..347cc8c 100644 --- "a/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/MainWindow.xaml.cs" +++ "b/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/MainWindow.xaml.cs" @@ -144,9 +144,9 @@ private void OnWork(object sender, DoWorkEventArgs e) StatusChange(nStatus); status = nStatus; } - - var localplayer = Scanner.ReadIntPtr(Data.ActorTable); - if (localplayer == IntPtr.Zero || !Data.IsGathering) + + var localPlayer = Scanner.ReadIntPtr(Data.ActorTable); + if (localPlayer == IntPtr.Zero) { Reset(); Status.End(); @@ -156,10 +156,12 @@ private void OnWork(object sender, DoWorkEventArgs e) continue; } - var buffTablePtr = localplayer + Data.UiStatusEffects; - BuffCheck(buffTablePtr); + if (!Data.IsGathering) Fish.Reset(); OceanFishingZoneCheck(); WeatherCheck(Data.WeatherPtr); + var buffTablePtr = localPlayer + Data.UiStatusEffects; + BuffCheck(buffTablePtr); + if (Fish.State == FishingState.Casting) Fish.Update(); if (Status.IsActive) Status.Update(); diff --git "a/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/Fish.cs" "b/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/Fish.cs" index f955543..7678a4c 100644 --- "a/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/Fish.cs" +++ "b/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/Fish.cs" @@ -73,7 +73,7 @@ public void Reset() //起身后,界面重置。 State = FishingState.None; Update(); - } + } public void Update() { diff --git "a/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/SigScanner.cs" "b/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/SigScanner.cs" index b511cb4..1fabd87 100644 --- "a/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/SigScanner.cs" +++ "b/\346\270\224\344\272\272\347\232\204\347\233\264\346\204\237/Models/SigScanner.cs" @@ -201,8 +201,7 @@ public IntPtr ScanText(string signature) var scanSize = textSectionBytes.Count - bytes.Length; for (var i = 0; i < scanSize; i++) { - if (firstByte != 0xFFFF) - i = textSectionBytes.IndexOf((byte)firstByte, i); + if (firstByte != 0xFFFF && (i = textSectionBytes.IndexOf((byte)firstByte, i)) == -1) break; var found = true; @@ -215,7 +214,6 @@ public IntPtr ScanText(string signature) found = false; break; } - if (!found) continue; scanRet = TextSectionBase + i;