Skip to content

Fix throwable weapon throw distance on high FPS - #5358

Open
MohabCodeX wants to merge 2 commits into
multitheftauto:masterfrom
MohabCodeX:fix/throwable-weapons-high-fps
Open

Fix throwable weapon throw distance on high FPS#5358
MohabCodeX wants to merge 2 commits into
multitheftauto:masterfrom
MohabCodeX:fix/throwable-weapons-high-fps

Conversation

@MohabCodeX

Copy link
Copy Markdown
Contributor

Problem

  1. Throw Force: On high FPS, throwing animations reach the release keyframe faster in real time (355ms for satchels, 441ms for grenades) before m_ButtonCounter reaches its native ceiling (433ms/533ms), resulting in lower launch velocity.
  2. Landing Distance: Discrete 30 FPS Euler integration moves the projectile ~26cm forward in its final landing frame before collision is registered. High FPS samples contact continuously, eliminating this step overshoot.

Solution

Instead of hooking CObject::ProcessControl (which affects all world objects and only accounts for ~4cm of slide), we hook CTaskSimpleThrowProjectile::ProcessPed at 0x62B01E:

  • Normalizes full-charge throws to the native ceiling when held until release.
  • Enforces 160ms floor for quick-taps and rescales partial holds linearly.
  • Applies timeStep-based compensation for satchels to ensure identical landing distance (~6.33m) across 30, 60, and 240+ FPS.

Testing

Before/After: https://streamable.com/mh6eue

Copilot AI lite review requested due to automatic review settings September 10, 2026 22:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…pons-high-fps

# Conflicts:
#	Client/multiplayer_sa/CMultiplayerSA_FrameRateFixes.cpp
Copilot AI review requested due to automatic review settings September 10, 2026 23:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants