Skip to content

Fix animations progress & sync#4821

Open
FileEX wants to merge 11 commits intomultitheftauto:masterfrom
FileEX:bugfix/animations_progress
Open

Fix animations progress & sync#4821
FileEX wants to merge 11 commits intomultitheftauto:masterfrom
FileEX:bugfix/animations_progress

Conversation

@FileEX
Copy link
Copy Markdown
Member

@FileEX FileEX commented Apr 18, 2026

Summary

  • Time synchronization refactor for animations (server-authoritative clock)
  • Replaced unreliable GetTimestamp() / GetTickCount64_ usage with a monotonic steady_clock-based tick system.
  • Fixed a bug where the server was sending elapsedTime while the client treated it as startTime.
  • setPedAnimationProgress now runs in the "same" frame as setPedAnimation (setPedAnimationProgress() does not work when called in the same frame as setPedAnimation() #1172).
  • When setPedAnimationProgress is set to 0 on the server, it refreshes the animation startTime.
  • On the server side, setPedAnimationProgress updates the animation startTime, ensuring all clients play the animation from the same progress point.

Motivation

Fixes #1172

Test plan

crun ped = createPed(50, getElementPosition(me))
crun setPedAnimation(ped, "ped", "ko_shot_face", -1, false, false, false, true) setPedAnimationProgress(ped, "ko_shot_face", 0.5)

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@FileEX FileEX added sync bugfix Solution to a bug of any kind labels Apr 18, 2026
@FileEX FileEX mentioned this pull request Apr 20, 2026
1 task
@FileEX FileEX added this to the 1.7 (Current) milestone May 7, 2026
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 sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setPedAnimationProgress() does not work when called in the same frame as setPedAnimation()

1 participant