source-sdk-2013
source-sdk-2013 copied to clipboard
hl2mp: Fix phantom weapon fire when throwing an object with `hl2mp_allow_pickup`
Description
With hl2mp_allow_pickup ConVar enabled, when a player picks up a prop and tries to throw it, a fake weapon fire on that client will be triggered. This PR fixes this issue by adding an early return in CWeaponHL2MPBase::ItemPostFrame( void ) that gets run when the player is holding an object.
In order to let the client know that it is holding an object a networked boolean was also added to HL2 local data that tracks if the player is holding an object or not.
Closes:
- https://github.com/ValveSoftware/Source-1-Games/issues/7037
https://github.com/user-attachments/assets/ed901653-40d9-45e2-9ec5-5bd07e5d9f37
^ before
https://github.com/user-attachments/assets/6a35573e-644b-4220-bc8b-06d387320192