Skip to content

Commit

Permalink
修复部分问题 (#13)
Browse files Browse the repository at this point in the history
* 修复幻海导致计时不显示的bug(#11),以及非钓鱼状态cpu占用过高的问题

* 1.修改为在幻海以及特殊天气时,取消钓鱼不会重置天气倒计时,并且保持显示
2.修复在非钓鱼状态cpu占用过高的问题
3.修复启动时因死循环问题导致的无法使用
  • Loading branch information
Cheney0120 authored Aug 9, 2024
1 parent 2bc5077 commit 2400615
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 7 additions & 5 deletions 渔人的直感/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion 渔人的直感/Models/Fish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void Reset()
//起身后,界面重置。
State = FishingState.None;
Update();
}
}

public void Update()
{
Expand Down
4 changes: 1 addition & 3 deletions 渔人的直感/Models/SigScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -215,7 +214,6 @@ public IntPtr ScanText(string signature)
found = false;
break;
}

if (!found)
continue;
scanRet = TextSectionBase + i;
Expand Down

0 comments on commit 2400615

Please sign in to comment.