release all key before tp & release all key after auto fight

This commit is contained in:
辉鸭蛋
2025-03-06 00:22:12 +08:00
parent 99df54607d
commit fc2c809702
2 changed files with 7 additions and 0 deletions

View File

@@ -332,6 +332,10 @@ public class AutoFightTask : ISoloTask
Debug.WriteLine(e.StackTrace);
throw;
}
finally
{
Simulation.ReleaseAllKey();
}
}, cts2.Token);
await fightTask;

View File

@@ -134,6 +134,9 @@ public class TpTask(CancellationToken ct)
/// <param name="force">强制以当前的tpX,tpY坐标进行自动传送</param>
private async Task<(double, double)> TpOnce(double tpX, double tpY, bool force = false)
{
// tp 前释放所有按键
Simulation.ReleaseAllKey();
await Delay(20, ct);
// 1. 确认在地图界面
await CheckInBigMapUi();