fix(worlds/minecraft): auto 攻击 8 格外弓射不出时受阻收手,不再空转占住事件循环 - #183
Merged
Merged
Conversation
auto 在 8 格外选弓;这一箭被即时拒绝(射线被挡、太近、没弹道)后改近战, 下一轮按同一距离又选回弓。拒绝不经过定时器,循环一直不让出事件循环, 心跳与实体更新进不来,服务端判超时断线。 现在 8 格外射不出就受阻,回执写明原因、相距格数和已放箭数,换站位由 agent 决定; 8 格内照旧改近战。 Fixes #175 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…写现行规则 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.


中文
修 #175。
skillAttack的 auto 模式在 8 格外选弓;BowController.shoot即时拒绝(no_los/too_close/no_solution等)后,原代码改近战并continue,下一轮chooseHybridWeapon('melee', d≥8)又选回弓。拒绝路径不经过定时器,循环一直不让出事件循环,心跳和实体更新进不来,服务端判Timed out。受阻处理契约:
目标被方块挡住,没有射线;相距 36 格,auto 在 8 格外不改近战;挥击 0 次命中 0 次,放箭 7 支命中 0 支。换站位、等待或改mode由 agent 决定,与 ranged/kite 受阻不暗换近战的做法一致。判断用
chooseHybridWeapon('melee', 当前距离, ready)本身,与下一轮选武器的规则同源,不另设阈值。技能说明和 minecraft README 同步写了这条。验证:新增测试用真
BowController制造 20 格外no_los,修复前该测试在 2 秒墙钟取消时以aborted失败(期间零延时定时器进不来),修复后一次拒绝即受阻。issue 附带的attack-spin.mjs两条入口(no_los / too_close)现在都只拒绝 1 次就退出。未连真服务器实测。English
Fixes #175. In auto mode, a bow shot rejected immediately at 8+ blocks switched to melee and looped; the next iteration picked the bow again, so the loop never yielded and the server timed the bot out. Now a rejected shot at a distance where auto would re-pick the bow ends the step as blocked, reporting the reason, distance and attack stats; the agent decides where to reposition. Within 8 blocks the melee fallback is unchanged. A new test drives the real
BowControllerwith ano_losrejection at 20 blocks; it fails on the old code (wall-clock abort, zero-delay timer starved) and passes now. Not verified against a live server.Checks
pnpm testpnpm run typecheckpnpm typecheck:web(browser code changed / 改了浏览器代码)🤖 Generated with Claude Code