Skip to content

Commit 6100e85

Browse files
committed
fix: 暂停状态漂移检测
1 parent f5922eb commit 6100e85

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

custom/action/executor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,12 @@ def _pause(self, context: Context, ctrl: Controller) -> None:
402402
一旦没真暂停后续逐帧/部署/技能全错。
403403
"""
404404
if self._paused:
405-
return
405+
img = ctrl.post_screencap().wait().get()
406+
reco = context.run_recognition("BattlePaused", img)
407+
if reco and reco.hit:
408+
return
409+
logger.warning("内部暂停状态与游戏画面不一致,重新尝试暂停")
410+
self._paused = False
406411
max_retries = 20
407412
for i in range(max_retries):
408413
afa_hotkey.tap_key(afa_hotkey.VK_F)

0 commit comments

Comments
 (0)