[PR #5633] [MERGED] Check a menu's stillValid before every click #6404

Closed
opened 2026-11-03 06:20:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5633
Author: @rdbtCVS
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/menu-still-valid-on-click


📝 Commits (2)

  • a65385f Close a leaving guest's open menu before the player is saved
  • f79e3b7 Check a menu's stillValid before every guest click

📊 Changes

6 files changed (+223 additions, -63 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+27 -6)
📝 crates/horizon-client/src/game/lan_actions.rs (+118 -9)
📝 crates/horizon-client/src/game/lan_crafting.rs (+2 -2)
📝 crates/horizon-client/src/game/lan_mount_menu.rs (+19 -15)
📝 crates/horizon-client/src/game/lan_stations.rs (+31 -14)
📝 crates/horizon-client/src/game/lan_trading.rs (+26 -17)

📄 Description

🤖 Opened by rdbtCVS's AI agent (Claude Code, Sonnet 5.5), not by rdbtCVS personally.

Stacked on #5630: the first commit is that PR's guest_close_all; review only the second commit.

Menus were checked for validity once per tick, after the packet phase, so a click could still reach a menu whose vehicle was gone, whose mount had died or left reach, whose lectern was out of reach, or whose station block was replaced.

  • One shared check, guest_menu_still_valid, covers every menu kind (container/vehicle, trade, crafting table, station, lectern, mount) through a per-kind predicate.
  • It runs at the top of the packet handling for every menu click (container click, button, slot state, rename, beacon, trade select, bundle select, place recipe). An invalid menu closes like ContainerClose and the click lands on nothing.
  • The per-tick checks now use the same predicates.

Checks run: cargo fmt, cargo clippy -p horizon-client --lib --bins -D warnings. Not run: lan_e2e and the parity harnesses (no vanilla data in this checkout).

🤖 Generated with Claude Code


🔄 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/5633 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/menu-still-valid-on-click` --- ### 📝 Commits (2) - [`a65385f`](https://github.com/horizon-rust/horizon/commit/a65385ff3efca22569c0140d74fe298ff1afbf9f) Close a leaving guest's open menu before the player is saved - [`f79e3b7`](https://github.com/horizon-rust/horizon/commit/f79e3b7e60f3aba7430063923c8cdeace1c3cd07) Check a menu's stillValid before every guest click ### 📊 Changes **6 files changed** (+223 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+27 -6) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+118 -9) 📝 `crates/horizon-client/src/game/lan_crafting.rs` (+2 -2) 📝 `crates/horizon-client/src/game/lan_mount_menu.rs` (+19 -15) 📝 `crates/horizon-client/src/game/lan_stations.rs` (+31 -14) 📝 `crates/horizon-client/src/game/lan_trading.rs` (+26 -17) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (Claude Code, Sonnet 5.5), not by rdbtCVS personally. Stacked on #5630: the first commit is that PR's `guest_close_all`; review only the second commit. Menus were checked for validity once per tick, after the packet phase, so a click could still reach a menu whose vehicle was gone, whose mount had died or left reach, whose lectern was out of reach, or whose station block was replaced. - One shared check, `guest_menu_still_valid`, covers every menu kind (container/vehicle, trade, crafting table, station, lectern, mount) through a per-kind predicate. - It runs at the top of the packet handling for every menu click (container click, button, slot state, rename, beacon, trade select, bundle select, place recipe). An invalid menu closes like `ContainerClose` and the click lands on nothing. - The per-tick checks now use the same predicates. Checks run: `cargo fmt`, `cargo clippy -p horizon-client --lib --bins -D warnings`. Not run: `lan_e2e` and the parity harnesses (no vanilla data in this checkout). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:20:00 +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#6404
No description provided.