mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2026-08-03 20:24:36 +02:00
Fix Vaccinator charge sounds playing 2+ times/tick
Due to prediction, the PrimaryAttack() function runs multiple times every tick. Every time the function runs on a tick where the player gains another charge, it will stack a copy of the sound that plays, which quickly becomes extremely loud. Commonly this will play 2 or 3, but in testing I've seen upwards of 7 or 8 playing at the same time.
This commit is contained in:
committed by
EricS-Valve
parent
f4536119bb
commit
70e325908b
@@ -1357,7 +1357,7 @@ bool CWeaponMedigun::FindAndHealTargets( void )
|
||||
}
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
if ( GetMedigunType() == MEDIGUN_RESIST )
|
||||
if ( GetMedigunType() == MEDIGUN_RESIST && prediction->IsFirstTimePredicted() )
|
||||
{
|
||||
// Play a sound when we tick over to a new charge level
|
||||
int nChargeLevel = int(floor(flNewLevel/flMinChargeAmount));
|
||||
|
||||
Reference in New Issue
Block a user