Skip to content

修复武器类 CBM 激活后手持其他物品会报错 - #1241

Merged
WhiteCloud0123 merged 1 commit into
mainfrom
dev
Oct 15, 2026
Merged

WhiteCloud0123 merged 1 commit into
mainfrom
dev

Conversation

@WhiteCloud0123

@WhiteCloud0123 WhiteCloud0123 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Fixed handling of weapons that cannot be unwielded: the associated bionic is now deactivated directly, and the action reports whether deactivation succeeded. This corrects cases where the action could report success without actually deactivating the bionic.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 微风自动审查

本次 PR 共修改 1 个文件,新增 1 行,删除 1 行。

变更范围: C++ 核心代码

自动风险提示:

  • ⚠️ 修改了 C++ 核心代码但没有同步修改 tests/,建议确认现有测试是否已经覆盖本次行为变化。
  • ⚠️ 触及存档、地图、载具、角色、物品或库存核心路径,属于较高回归风险区域。

建议测试内容:

  • 快速检查: 检查补丁空白、变更 JSON/Python/XML/Visual Studio 项目文件、未解决合并标记,以及内置穆尔卡武器工坊关键路径。
  • Windows Tiles x64 MSVC: 编译翻译,执行完整 Release x64 MSVC 构建和 windist 打包,并验证 Windows 构件中的内置武器工坊。
  • Windows 数据加载烟雾测试: 运行打包后的 cataclysm-tiles.exe --jsonverify,确认可执行文件能够真正启动并完成核心游戏数据加载;Windows 构件会先上传,烟雾测试失败时仍可下载人工排查。
  • Android Gradle 快速检查: 使用 JDK 11 解析 Gradle 配置和依赖,提前发现 Android 构建环境或脚本问题。
  • Android arm64: 编译翻译和 arm64 Release APK,并保留 APK 构件供设备实测。

这是规则型自动审查,会依据本次 PR 的实际变更范围生成风险提示和测试建议,不假定 PR 的来源或用途,也不替代人工代码审查。每次推送后会自动更新这条摘要。

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0fd65c09-fc0e-4ec0-82e1-ce5d05e28d1d
📥 Commits

Reviewing files that changed from the base of the PR and between 4784953 and 6db3f75.

📒 Files selected for processing: 1
  • src/character.cpp

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

For a NO_UNWIELD weapon, Character::unwield now calls deactivate_bionic and returns its result.

Changes: NO_UNWIELD Bionic Deactivation

Layer / File(s) Summary
Attempt bionic deactivation
src/character.cpp
For a NO_UNWIELD weapon, Character::unwield attempts bionic deactivation and returns the operation’s result.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: andyscarlet233

Merge Risk: ⚪ Minimal · up to 6db3f

Unwielding a NO_UNWIELD bionic weapon now deactivates the bionic and clears the weapon. No outstanding merge-blocking risk is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题准确描述了主要修复内容:解决武器类 CBM 激活后手持其他物品时报错的问题。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Cppcheck (2.22.0)
src/character.cpp

Cppcheck timed out; analysis of this file is incomplete

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WhiteCloud0123
WhiteCloud0123 merged commit d4da501 into main Oct 15, 2026
6 checks passed
@WhiteCloud0123
WhiteCloud0123 deleted the dev branch October 17, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant