source-sdk-2013
source-sdk-2013 copied to clipboard
[HL2MP] Lag Compensation Fix
This commit removes 2 checks for CHL2MP_Player::WantsLagCompensationOnEntity. The checks are problematic for 2 reasons:
- The IN_ATTACK check will not work for the shotgun's secondary attack.
- Any weapon with a delayed trace attack will not lag compensate (the shotgun delays its attacks while reloading and holding the attack button).
Even if these problems didn't exist, trying to early out with these checks wouldn't help anything because the function is only called in CLagCompensationManager::StartLagCompensation, which is only called in weapon attack functions where an attack button would've most likely been pressed.
sv_showlagcompensation is enabled in the following gameplay footage Before:
https://github.com/user-attachments/assets/09acfe53-6f33-405b-a434-3fcc07ab652a
After:
https://github.com/user-attachments/assets/7345bc2e-b583-4b57-ab5b-83fa897d4bb7