Skip to content

Conversation

@ficool2
Copy link
Contributor

@ficool2 ficool2 commented Nov 1, 2025

The Spy watch has broken prediction when deploying/holstering, and likewise when adding or removing the cloak conditions. This PR addresses those issues. Specifically it does the following:

  1. Fixed m_hOffHandWeapon not being defined in the send table. This was originally declared as a networked variable, so this was clearly an oversight
  2. Defines several variables used by the watches as predicted, so they are correctly restored when simulating prediction
  3. Makes CTFPlayerShared run the OnAddStealthed/OnRemoveStealthed callbacks in every step of prediction rather than just once per frame, but skips processing particles/sounds/etc to not stack those up
  4. The spy watch relied on a think function to hide itself. However, think functions applied to a weapon (rather than a player) run on different clocks on client versus server, so this would lead to a desync. Instead, this hiding logic has been moved to the ItemFrame functions, which use the player clock

Visually, this makes the spy watches not skip their animations or jitter all over the place. It also prevents a view hitch when cloaking/uncloaking while moving.

NOTE: for best results, this should be combined with #1606. The videos were recorded with that PR merged in. Tested with net_fakelag 100.

Before:

hl2_win64_sE0gKeDNFu.mp4

After:

hl2_win64_wzAz5f0bgT.mp4

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.

1 participant