This commit is contained in:
The Fatcat 2025-12-16 19:28:50 +00:00 committed by GitHub
commit 1e40c83eef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -445,7 +445,11 @@ void CTFSniperRifle::PlayWeaponShootSound( void )
{
float flDamageBonus = 1.0f;
CALL_ATTRIB_HOOK_FLOAT( flDamageBonus, sniper_full_charge_damage_bonus );
if ( flDamageBonus > 1.0f )
const CEconItemView* pItem = GetAttributeContainer()->GetItem();
// Fixes rifles with "sniper_full_charge_damage_bonus"
// playing an undefined "SPECIAL3" sound when not fully charged.
// Improvement By Bitl
if ( flDamageBonus > 1.0f && ( pItem && pItem->GetStaticData()->GetWeaponReplacementSound( GetTeamNumber(), SPECIAL3 )))
{
WeaponSound( SPECIAL3 );
return;