[Audio] Fix ordering of hitsound calls in CBaseHLBludgeonWeapon::Swing() and play melee hitsound in CBaseHLBludgeonWeapon::Hit() #1499
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR properly fixes melee weapon hit sounds in Half-Life 2 and derivative mods by adding a missing
WeaponSound( MELEE_HIT )
call at the end of the hit target entity check inCBaseHLBludgeonWeapon::Hit()
, and changes the ordering of the swingWeaponSound
call inCBaseHLBludgeonWeapon::Swing()
to be placed within the miss conditional block.hl2_2025-08-18_11-51-14.mp4
mod_episodic_win64_2025-08-18_11-48-23.mp4
Note
This exact hitsound fix is only partially present in live HL2 exclusively for the player stunstick ent (
weapon_stunstick_player
). The regular stunstick (weapon_stunstick
) and crowbar/mattpipe (weapon_crowbar
) do not have this change, because the fix that's included is in the wrong place!hl2_2025-08-18_12-03-59.mp4