Fix overlapping footstep sound

This commit is contained in:
TheNotoriousFrogposter 2025-03-31 17:07:40 +08:00
parent ceb6d4d783
commit 254dfa2326
3 changed files with 13 additions and 0 deletions

View file

@ -124,6 +124,7 @@ public:
virtual void Simulate( void );
virtual void FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options ) OVERRIDE;
virtual void UpdateStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity ) OVERRIDE;
virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
CNewParticleEffect *SpawnHalloweenSpellFootsteps( ParticleAttachment_t eParticleAttachment, int iHalloweenFootstepType );

View file

@ -911,6 +911,8 @@ public:
CTFWeaponBase *Weapon_OwnsThisID( int iWeaponID ) const;
CTFWeaponBase *Weapon_GetWeaponByType( int iType );
virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
medigun_charge_types GetChargeEffectBeingProvided( void );
// Achievements

View file

@ -12720,6 +12720,16 @@ bool CTFPlayer::Weapon_CanSwitchTo( CBaseCombatWeapon *pWeapon )
return bCanSwitch;
}
void CTFPlayer::PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force )
{
#ifdef CLIENT_DLL
// Don't make predicted footstep sounds in third person, animevents will take care of that.
if ( prediction->InPrediction() && C_BasePlayer::ShouldDrawLocalPlayer() )
return;
#endif
BaseClass::PlayStepSound( vecOrigin, psurface, fvol, force );
}
//-----------------------------------------------------------------------------
// Purpose: Gives the player an opportunity to abort a double jump.