[PR #1903] [MERGED] Clear off-hand items in vanilla inventory slot order #3850

Closed
opened 2026-11-03 04:12:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1903
Author: @rdbtCVS
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/clear-offhand-slot-order


📝 Commits (1)

  • 481e75b Clear off-hand items in vanilla inventory slot order

📊 Changes

2 files changed (+23 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+6 -3)
📝 tools/command_exec_corpus.py (+17 -0)

📄 Description

🤖 Opened by rdbtCVS's AI agent (OpenAI Codex, GPT-6.1).

/clear skipped the off-hand slot and visited armor head first. A shield could survive a full clear and block subsequent item use; a limited clear could remove the wrong equipped item.

Follow vanilla 26.3 Inventory.clearOrCountMatchingItems, getContainerSize, getItem and the equipment-slot mapping: main inventory, armor feet to head, off hand, then crafting slots and the carried stack. Extend the command oracle with off-hand counting, partial/full removal and armor-order cases.

Validation: the vanilla command oracle matched 843/843 command/callback records, with zero mismatches. This is the /clear fix extracted from #1567; it targets main independently of the integration migration.

Source self-check below ran with lab.game_env() scratch homes. Broad parity is listed for CI; the command oracle was run separately.

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 8177a6f45, 2 min 25 s)

Check Result
Scope ✅ 2 files, +23 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 287 passed (21 s)
rustfmt ✅ (5 s)
clippy ✅
tests: horizon-client ✅ 1241 passed (1 min 47 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 24 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, locator_bar, mace, online_mode, sculk, section_mesh and 12 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with OpenAI Codex.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1903 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/clear-offhand-slot-order` --- ### 📝 Commits (1) - [`481e75b`](https://github.com/horizon-rust/horizon/commit/481e75bc33bea120cad48a40294fdaf3df2b19aa) Clear off-hand items in vanilla inventory slot order ### 📊 Changes **2 files changed** (+23 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+6 -3) 📝 `tools/command_exec_corpus.py` (+17 -0) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (OpenAI Codex, GPT-6.1). `/clear` skipped the off-hand slot and visited armor head first. A shield could survive a full clear and block subsequent item use; a limited clear could remove the wrong equipped item. Follow vanilla 26.3 `Inventory.clearOrCountMatchingItems`, `getContainerSize`, `getItem` and the equipment-slot mapping: main inventory, armor feet to head, off hand, then crafting slots and the carried stack. Extend the command oracle with off-hand counting, partial/full removal and armor-order cases. Validation: the vanilla command oracle matched **843/843 command/callback records**, with zero mismatches. This is the `/clear` fix extracted from #1567; it targets `main` independently of the integration migration. Source self-check below ran with `lab.game_env()` scratch homes. Broad parity is listed for CI; the command oracle was run separately. **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 8177a6f45, 2 min 25 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +23 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 287 passed (21 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ | | tests: horizon-client | ✅ 1241 passed (1 min 47 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 24 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, locator_bar, mace, online_mode, sculk, section_mesh and 12 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [OpenAI Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:47 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3850
No description provided.