Skip to content

Commit

Permalink
session/world.go: Only ignore player's own movement while moving as a…
Browse files Browse the repository at this point in the history
… result of playerauthinput packet.

(Mostly) resolves #463.
  • Loading branch information
Sandertv committed Dec 16, 2024
1 parent 721851d commit c9ded13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/session/handler_player_auth_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (h PlayerAuthInputHandler) handleMovement(pk *packet.PlayerAuthInput, s *Se
s.teleportPos.Store(nil)
}

s.moving = true
c.Move(deltaPos, deltaYaw, deltaPitch)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion server/session/world.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (s *Session) HideEntity(e world.Entity) {
// ViewEntityMovement ...
func (s *Session) ViewEntityMovement(e world.Entity, pos mgl64.Vec3, rot cube.Rotation, onGround bool) {
id := s.entityRuntimeID(e)
if id == selfEntityRuntimeID || s.entityHidden(e) {
if (id == selfEntityRuntimeID && s.moving) || s.entityHidden(e) {
return
}

Expand Down

0 comments on commit c9ded13

Please sign in to comment.