Skip to content

Conversation

@Xenius97
Copy link
Contributor

Fixes #4556

The same issue was already attempted to be fixed in PR #4436, but it seems it was not successful. I tested it with the current solution, and it ran without any issues. As of now, it works.

The `SetFrozen` method was simplified by removing conditional logic
related to `m_pPlayerPed` and now always uses the cached `m_Matrix`
to update `m_matFrozen`. This leverages the fact that `m_Matrix` is
already updated by `SetCurrentRotation`.

In `SetCurrentRotation`, added logic to always update the Z-axis
rotation of `m_Matrix` when setting `fRotation`. This ensures
`m_matFrozen` gets the correct value in `SetFrozen` and maintains
consistency between the current rotation and the cached matrix.
@FileEX FileEX added the bugfix Solution to a bug of any kind label Nov 22, 2025
@FileEX FileEX merged commit 744b0cb into multitheftauto:master Nov 22, 2025
MTABot pushed a commit that referenced this pull request Nov 22, 2025
744b0cb Fix ped rotation sync is broken when using setElementFrozen instantly (#4566)
@FileEX FileEX added this to the 1.7.1 milestone Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ped rotation sync is broken when using setElementFrozen instantly

2 participants