Skip to content

Fix Player Model HUD corrupting entity head rotation#6514

Open
FabiFNA wants to merge 1 commit into
MeteorDevelopment:masterfrom
FabiFNA:patch-1
Open

Fix Player Model HUD corrupting entity head rotation#6514
FabiFNA wants to merge 1 commit into
MeteorDevelopment:masterfrom
FabiFNA:patch-1

Conversation

@FabiFNA

@FabiFNA FabiFNA commented Jul 8, 2026

Copy link
Copy Markdown

Type of change

  • Bug fix

Description

HudRenderer.entity() temporarily overwrites the rendered entity's rotation fields to pose the Player Model HUD element, then restores them. The restore of the head-yaw fields was swapped:

  • yHeadRot (current) was restored from the saved previous value
  • yHeadRotO (previous) was restored from the saved current value

So every frame the element is drawn, the entity's current and previous head yaw are exchanged, corrupting the head-rotation interpolation used by the world renderer. yBodyRot is restored correctly, so only head rotation is affected. This restores each field to its own saved value.

Related issues

None linked, reproducible whenever the Player Model HUD element is enabled.

How Has This Been Tested?

With the Player Model element enabled, head/body rotation visibly stutters when turning in a boat or on a horse and when looking at your own head in F5. Disabling only the Player Model element in HUD stops it. After this change the stuttering is gone and the element still renders correctly.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

## Type of change
- [x] Bug fix

## Description
`HudRenderer.entity()` temporarily overwrites the rendered entity's rotation
fields to pose the Player Model HUD element, then restores them. The restore of
the head-yaw fields was swapped:
- `yHeadRot` (current) was restored from the saved *previous* value
- `yHeadRotO` (previous) was restored from the saved *current* value

So every frame the element is drawn, the entity's current and previous head yaw
are exchanged, corrupting the head-rotation interpolation used by the world
renderer. `yBodyRot` is restored correctly, so only head rotation is affected.
This restores each field to its own saved value.

## Related issues
None linked — reproducible whenever the Player Model HUD element is enabled.

# How Has This Been Tested?
With the Player Model element enabled, head/body rotation visibly stutters when
turning in a boat or on a horse and when looking at your own head in F5. Disabling
only the Player Model element stops it. After this change the stuttering is gone and
the element still renders correctly.

# Checklist:
- [x] My code follows the style guidelines of this project.
- [x] I have added comments to my code in more complex areas.
- [x] I have tested the code in both development and production environments.
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