Skip to content

Fix DropActivePlayerWeapon passing uninitialized vecDropMomentum - #1407

Merged
roflmuffin merged 2 commits into
roflmuffin:mainfrom
Umbre11as:fix/drop-active-weapon-vector
Sep 5, 2026
Merged

roflmuffin merged 2 commits into
roflmuffin:mainfrom
Umbre11as:fix/drop-active-weapon-vector

Conversation

@Umbre11as

Copy link
Copy Markdown
Contributor

The vtable call for DropActivePlayerWeapon was missing the second parameter (const Vector& vecDropMomentum), so the native function read uninitialized stack for it — which could result in NaN entity velocity.

Passes an empty Vector to keep the public API stable, as suggested by @hzqst in the issue.

Tested on a live 1.0.373 server: weapon drops normally without abnormal velocity.

Closes #1214

@Umbre11as
Umbre11as requested a review from roflmuffin as a code owner August 30, 2026 03:43
@roflmuffin
roflmuffin enabled auto-merge (squash) September 5, 2026 00:49
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.

CCSPlayer_ItemServices_DropActivePlayerWeapon should be going with 2nd arg const Vector& vecDropMomentum

2 participants