[PR #3441] [MERGED] Guests' known movement: set on every move, zeroed at a tick end without one #4980

Closed
opened 2026-11-03 05:09:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3441
Author: @xKumorio
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix-arrow-known-movement


📝 Commits (3)

  • ad64477 Three Windows-only test failures in pr_ready
  • f9494ef Arrows shot mid-jump carry the jump: projectiles add the known movement
  • a91952a Merge main: keep only what #3085 doesn't have

📊 Changes

3 files changed (+20 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+7 -19)
📝 crates/horizon-client/src/lan/guest.rs (+4 -0)
📝 crates/horizon-client/src/lan/hub.rs (+9 -1)

📄 Description

🤖 Opened by xKumorio's AI agent (Claude Code), not by xKumorio themselves.

What and why

Reworked as asked in triage: I merged main, and this PR now holds only what #3085 doesn't. #3085 already has every projectile take known_player_movement(). This PR changes where a guest's known movement comes from.

In vanilla, ServerPlayer.lastKnownClientMovement is set by handlePlayerKnownMovement on every accepted move. handleClientTickEnd zeroes it when no move came that tick. Main copies g.moves.last() into Game::known_movement at a few call sites (UseItem, the spear's jab, the per-tick using turn). That gives zero once the tick's moves have been consumed, for example by the fall check, and it doesn't cover the other turns.

  • Guest::known_movement: set on each accepted move, and zeroed by a ClientTickEnd with no move that tick.
  • enter_guest puts it in Game::known_movement for every guest turn, and leave_guest restores the outer turn's value, so a nested turn doesn't leak its value into the turn around it.
  • The three moves.last() copies are gone, since enter_guest now covers every turn.

Three files, +20 −20. The duplicated projectile changes and the Windows test commit are dropped: main has them (#3085, #3088, #3587).

Vanilla reference

  • ServerGamePacketListenerImpl.handleMovePlayer → handlePlayerKnownMovement(clientDeltaMovement) → ServerPlayer.setKnownMovement.
  • ServerGamePacketListenerImpl.handleClientTickEnd: if (!receivedMovementThisTick) player.setKnownMovement(Vec3.ZERO).
  • ServerPlayer.getKnownMovement: lastKnownClientMovement (or the vehicle's).

Tested in game on Windows before the merge: arrows shot on a jump's way up carry it, and shots while sprinting carry the run. I didn't run tools/lan_e2e.py --check arrows because it needs Linux (vscreen).

Self-check

pr_ready (tools/pr_ready.py --quick on DESKTOP-OO8T34Q, against origin/main at 181040539, 5 min 22 s)

Check Result
Scope ✅ 3 files, +20 −20
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (1 min 1 s)
rustfmt ✅ (6 s)
clippy ✅ (45 s)
tests: horizon-client ✅ 832 passed (2 min 51 s)
doc tests ✅ 0 passed (36 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/3441 **Author:** [@xKumorio](https://github.com/xKumorio) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix-arrow-known-movement` --- ### 📝 Commits (3) - [`ad64477`](https://github.com/horizon-rust/horizon/commit/ad644778bc72b2702bb7f30c48d1e5b196e58e9b) Three Windows-only test failures in pr_ready - [`f9494ef`](https://github.com/horizon-rust/horizon/commit/f9494ef93eddec311c3a0aef0706bb5c349240e3) Arrows shot mid-jump carry the jump: projectiles add the known movement - [`a91952a`](https://github.com/horizon-rust/horizon/commit/a91952a8c089237cdb003c2b560cab7cd384981a) Merge main: keep only what #3085 doesn't have ### 📊 Changes **3 files changed** (+20 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+7 -19) 📝 `crates/horizon-client/src/lan/guest.rs` (+4 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+9 -1) </details> ### 📄 Description > 🤖 Opened by xKumorio's AI agent (Claude Code), not by xKumorio themselves. ## What and why Reworked as asked in triage: I merged main, and this PR now holds only what #3085 doesn't. #3085 already has every projectile take `known_player_movement()`. This PR changes where a guest's known movement comes from. In vanilla, `ServerPlayer.lastKnownClientMovement` is set by `handlePlayerKnownMovement` on every accepted move. `handleClientTickEnd` zeroes it when no move came that tick. Main copies `g.moves.last()` into `Game::known_movement` at a few call sites (UseItem, the spear's jab, the per-tick using turn). That gives zero once the tick's `moves` have been consumed, for example by the fall check, and it doesn't cover the other turns. - `Guest::known_movement`: set on each accepted move, and zeroed by a `ClientTickEnd` with no move that tick. - `enter_guest` puts it in `Game::known_movement` for every guest turn, and `leave_guest` restores the outer turn's value, so a nested turn doesn't leak its value into the turn around it. - The three `moves.last()` copies are gone, since `enter_guest` now covers every turn. Three files, +20 −20. The duplicated projectile changes and the Windows test commit are dropped: main has them (#3085, #3088, #3587). ## Vanilla reference - `ServerGamePacketListenerImpl.handleMovePlayer` → `handlePlayerKnownMovement(clientDeltaMovement)` → `ServerPlayer.setKnownMovement`. - `ServerGamePacketListenerImpl.handleClientTickEnd`: `if (!receivedMovementThisTick) player.setKnownMovement(Vec3.ZERO)`. - `ServerPlayer.getKnownMovement`: `lastKnownClientMovement` (or the vehicle's). Tested in game on Windows before the merge: arrows shot on a jump's way up carry it, and shots while sprinting carry the run. I didn't run `tools/lan_e2e.py --check arrows` because it needs Linux (`vscreen`). ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-OO8T34Q, against origin/main at 181040539, 5 min 22 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +20 −20 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (1 min 1 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (45 s) | | tests: horizon-client | ✅ 832 passed (2 min 51 s) | | doc tests | ✅ 0 passed (36 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 05:09:21 +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#4980
No description provided.