A mod menu button runs as the player who pressed it

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
Federico TaglianiandClaude Sonnet 5.5 committed 2026-11-02 00:17:41 +01:00
1 parent c9d49d4328
commit b4b5281ff8
1 file changed
+5 -1
@@ -417,7 +417,11 @@ impl Game<'_> {
// its own host too (`lan.rs:165`), so this one path covers
// both single player and a LAN guest.
let mut carried = g.carried.clone();
self.mod_menu_button(pos, id, &mut carried);
// As that player: `native_acting_player`, `native_acting_id`
// and `native_give_stack` answer for the one who pressed.
self.as_guest(host, conn, |game| {
game.mod_menu_button(pos, id, &mut carried)
});
if host.hub.guest(conn).is_some_and(|g| g.carried != carried) {
let net = host.hub.stack(&carried);
if let Some(g) = host.hub.guest_mut(conn) {