[PR #6577] [MERGED] A mod menu button runs as the player who pressed it #6959

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

📋 Pull Request Information

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

Base: main ← Head: fix/menu-button-acting-player


📝 Commits (1)

  • b4b5281 A mod menu button runs as the player who pressed it

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_stations.rs (+5 -1)

📄 Description

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

Fixes #6557

lan_station_button (game/lan_stations.rs) called mod_menu_button with the host out of self.lan and no guest swapped in, so inside native_menu_button_v2 native_acting_player() was None, native_acting_id() was not the presser's and native_give_stack handed every stack back. The doc of the hook promises the acting player's cursor stack, and native_give_stack's doc says "from any server hook".

The call now runs inside as_guest(host, conn, ...), as the guest's other actions do (give_levels, the enchanting table). With the guest's state in place, lan_acting_* is set and native_give_stack for the acting id gives into their inventory. carried is still read from the guest before and written back after, as before.

No new test: nothing in the tree drives a native hook end to end (hooks are default methods a bundle overrides), and the swap itself is as_guest's, which the guest actions already rely on. I did not run the reproduction bundle from the issue. cargo clippy -p horizon-client --tests.

🤖 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/6577 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/menu-button-acting-player` --- ### 📝 Commits (1) - [`b4b5281`](https://github.com/horizon-rust/horizon/commit/b4b5281ff8215b9a878fcf1161abbaaec26b3cef) A mod menu button runs as the player who pressed it ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_stations.rs` (+5 -1) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #6557 `lan_station_button` (`game/lan_stations.rs`) called `mod_menu_button` with the host out of `self.lan` and no guest swapped in, so inside `native_menu_button_v2` `native_acting_player()` was None, `native_acting_id()` was not the presser's and `native_give_stack` handed every stack back. The doc of the hook promises the acting player's cursor stack, and `native_give_stack`'s doc says "from any server hook". The call now runs inside `as_guest(host, conn, ...)`, as the guest's other actions do (`give_levels`, the enchanting table). With the guest's state in place, `lan_acting_*` is set and `native_give_stack` for the acting id gives into their inventory. `carried` is still read from the guest before and written back after, as before. No new test: nothing in the tree drives a native hook end to end (hooks are default methods a bundle overrides), and the swap itself is `as_guest`'s, which the guest actions already rely on. I did not run the reproduction bundle from the issue. `cargo clippy -p horizon-client --tests`. 🤖 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:30:19 +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#6959
No description provided.