Fix setCameraTarget not syncing camera rotation to ped heading (#4915)#5013
Fix setCameraTarget not syncing camera rotation to ped heading (#4915)#5013QueryOfficial wants to merge 2 commits into
Conversation
- Updated CClientCamera to set camera rotation for the local player when not in a vehicle. - Modified CClientPed to ensure frozen state rotation is updated correctly. - Adjusted CPedRPCs to set camera rotation for local players outside of fixed camera mode.
|
thx gpt |
Hey, what exactly is your point in commenting “thx gpt” under every commit I make? The first time you wrote it, I didn’t say anything. But repeating it under every commit feels unnecessary and disrespectful. If you have a technical concern about the code, feel free to point it out properly. Otherwise, I’d appreciate it if you stopped making these kinds of comments. Thanks. |
|
should probably check why your LLM slop is failing to build before you ask me for technical concerns |
- Changed the camera rotation logic for local players to reference m_pCamera instead of g_pClientGame. - Ensures proper camera rotation is applied when the local player is not in fixed camera mode.
|
No one claimed that the commit was 100% perfect. It has only been around 20 minutes since I pushed it, and when I saw that it failed to build, I already started addressing it. The issue was caused by a Build issues can happen during development, especially when working across changing code. That is exactly why CI exists. What I don’t understand is why you feel the need to make these kinds of comments instead of simply pointing out the technical issue. Have you made a habit of talking down to people who are trying to contribute? |
|
"hey chatgpt reply to this guy who's saying my commits are LLM slop, it's clearly not! :(" |
|
I’m not even taking you seriously at this point. If mocking people is all you can contribute, keep crying. |
Summary
Fixes a 1.7 regression where
setCameraTarget(player)does not reliably align the camera with the ped's rotation after a server-side rotation change, especially on a frozen local player.Changes:
SetFocusToLocalPlayerImpl()afterRestoreWithJumpCut()m_matFrozenrotation in sync when rotation is changed on a frozen pedSET_PED_ROTATIONwhen not in fixed camera modeMotivation
Fixes #4915.
In MTA 1.6,
setCameraTarget(client)consistently reset the camera to match the player's on-foot rotation. In 1.7 this became inconsistent; the camera often stayed wrong, commonly ~180° opposite to the ped.The main causes were:
setCameraTargetonly restored camera focus viaRestoreWithJumpCut()and did not sync camera rotation to ped headingsetElementRotationdid not update camera rotation for playersSetCurrentRotation()updatedm_Matrixbut notm_matFrozen, soStreamedInPulse()could revert the ped to the old rotation on the next frameTest plan
Reproduced the original report flow (frozen local player, server-side dimension/interior/rotation change, then
setCameraTarget) and confirmed the camera now matches ped rotation instead of often ending up ~180° off. Also checked the same flow without freeze and after unfreeze.Checklist