[PR #5587] [MERGED] Server: a guest's body collides with the world border #6370

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

📋 Pull Request Information

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

Base: main ← Head: fix/2743-guest-border-collision


📝 Commits (1)

  • b264a7d Server: a guest's body collides with the world border

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+3 -0)

📄 Description

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

The server never gave its players' bodies a world border: PlayerMotion.border was only filled by Game::player_border (game/commands/terrain_cmds.rs) for the window's own self.player. A server player's body (swapped in by enter_guest) kept border: None, so the server's simulation of their movement (server_travel, and the anticheat prediction, which copies the server body's border in lan/prediction.rs::sync) went straight through the border's walls while the client stopped at them.

In vanilla, Entity.collide → collectColliders adds the level's WorldBorder shape for every entity that is isInsideCloseToBorder, server players included. enter_guest (game/lan_actions.rs) now calls player_border() once the guest's body is in place. It runs on every turn, so the copy follows /worldborder changes and WorldBorder.tick lerps.

Hub::position_change's ±3.0E7 / ±2.0E7 clamp is left alone. It is vanilla's clampHorizontal/clampVertical in handleMovePlayer. The border is a collision shape, not a clamp: a body already outside is hurt (border_damage, which already works for guests) and can walk back.

The build/mine half of the issue was fixed by #2813.

Fixes #2743

Tests

  • cargo clippy -p horizon-client --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib -- lan::prediction border: 15 passed
  • python3 tools/lan_e2e.py --check border (server-thread host, guest a server client): pass (both players stop at 4.7 against a size-10 border and are hurt outside it)
  • tools/pr_ready.py --quick not run: the shared build machine is busy and a full run would take longer than this one-call change needs.

No new unit test: the change only wires the existing border into the guest body. Game can't be built in a unit test, and the border collision itself is already covered by collisions::border_movement_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/5587 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2743-guest-border-collision` --- ### 📝 Commits (1) - [`b264a7d`](https://github.com/horizon-rust/horizon/commit/b264a7d9d561d741a01f664af401a8d145f6ec68) Server: a guest's body collides with the world border ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by rdbtCVS's AI agent (Claude Code, Claude Opus 5.5), not by rdbtCVS personally. The server never gave its players' bodies a world border: `PlayerMotion.border` was only filled by `Game::player_border` (`game/commands/terrain_cmds.rs`) for the window's own `self.player`. A server player's body (swapped in by `enter_guest`) kept `border: None`, so the server's simulation of their movement (`server_travel`, and the anticheat prediction, which copies the server body's border in `lan/prediction.rs::sync`) went straight through the border's walls while the client stopped at them. In vanilla, `Entity.collide` → `collectColliders` adds the level's `WorldBorder` shape for every entity that is `isInsideCloseToBorder`, server players included. `enter_guest` (`game/lan_actions.rs`) now calls `player_border()` once the guest's body is in place. It runs on every turn, so the copy follows `/worldborder` changes and `WorldBorder.tick` lerps. `Hub::position_change`'s ±3.0E7 / ±2.0E7 clamp is left alone. It is vanilla's `clampHorizontal`/`clampVertical` in `handleMovePlayer`. The border is a collision shape, not a clamp: a body already outside is hurt (`border_damage`, which already works for guests) and can walk back. The build/mine half of the issue was fixed by #2813. Fixes #2743 ## Tests - `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib -- lan::prediction border`: 15 passed - `python3 tools/lan_e2e.py --check border` (server-thread host, guest a server client): pass (both players stop at 4.7 against a size-10 border and are hurt outside it) - `tools/pr_ready.py --quick` not run: the shared build machine is busy and a full run would take longer than this one-call change needs. No new unit test: the change only wires the existing border into the guest body. `Game` can't be built in a unit test, and the border collision itself is already covered by `collisions::border_movement_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:19:18 +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#6370
No description provided.