Skip to content

Apply relative-move flags on teleport#170

Open
Purdze wants to merge 1 commit intomasterfrom
fix/relative-teleport-echo
Open

Apply relative-move flags on teleport#170
Purdze wants to merge 1 commit intomasterfrom
fix/relative-teleport-echo

Conversation

@Purdze
Copy link
Copy Markdown
Collaborator

@Purdze Purdze commented Apr 21, 2026

Summary

The PlayerPosition handler echoed the raw p.change.pos. That is correct for the first login teleport (fully absolute), but wrong for any subsequent teleport that sets relative-move flags. The client would echo unadjusted deltas instead of the resulting absolute position.

  • Route PlayerPosition through NetworkEvent so the main thread has access to player state.
  • Apply each axis' relative flag (position, look, velocity) against current player state.
  • Update player, renderer camera, and chunk center, then echo the final absolute position.

Mid-game teleports with relative flags (e.g. /tp ~ ~10 ~, portal
corrections) were being dropped: the handler only applied the first
PlayerPosition at login and silently ignored the rest. Relative flags
were also not honoured, so an echo of p.change.pos would be wrong
whenever any flag was set.

Move the PlayerPosition handling to the main thread where the player
state lives, apply relative flags for position, rotation, and velocity,
then echo MovePlayerPosRot with the computed absolute values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant