fix: 修复副本战斗失败/撤退后返回大世界卡在退出战斗的死循环 - #2467
Open
Jason25417 wants to merge 1 commit into
Open
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughBackToNormalWorld 中新增对 ExitInBattle 的依赖,退出战斗分支不再自行维护两步点击状态,改为调用 ExitInBattle(self.ctx).execute() 完成点击与确认闭环;同时移除 handle_init 中的 click_exit_battle 状态成员。 Changes退出战斗逻辑重构
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
一条龙在副本战斗失败 / 撤退后返回大世界时,
返回大世界(BackToNormalWorld)会卡在「按钮-退出战斗」的识别循环,直到node_max_retry_times=60耗尽后整个算子失败。由于它是被到处调用的通用返回步骤,这一次卡死会连锁导致后续多个日常应用失败(体力刷本收尾、活跃度奖励、丽都城募、丽都周纪等)。复现
体力刷本的副本自动战斗**失败(战斗结果-撤退)**后,画面停在战斗菜单,返回大世界连续约 50 轮恒为「按钮-退出战斗」直至失败:根因
check_screen_and_run(单节点,node_max_retry_times=60)中退出战斗的分支:round_by_find_and_click_area的成功只代表模板找到并点击,不代表点击生效、确认框已弹出。当点击未真正推进时,下一轮仍会在第一处匹配到「按钮-退出战斗」并return,使得点确认框的分支永远够不到,自锁到 60 轮耗尽。日志全程只有「按钮-退出战斗」、从未出现「按钮-退出战斗-确认」,正是此自锁的表现。修复
复用仓库已有的
ExitInBattle——它用until_find_all/until_not_find_all做了「点退出战斗 → 等确认框出现 → 点确认 → 等确认框消失」的完整闭环,能保证点击真正生效后才推进:ExitInBattle闭环;self.click_exit_battle状态。测试
python -m py_compile通过,模块可正常 import(无循环 import);Summary by CodeRabbit