From 74e59c50c20190e923782e79211b7ebaa36f6def Mon Sep 17 00:00:00 2001 From: FlaminSarge Date: Mon, 8 Jun 2026 01:50:46 -0700 Subject: [PATCH] [TF2] Clamp pitch values for extra air dashes Prevents air dash sound pitch values from being set to >255, which overflows int m_nPitch Maintains previous scaling (1-5 -> 100-120 is now 1-32 -> 100-255, still scaling by 5 per dash). --- src/game/shared/tf/tf_gamemovement.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/shared/tf/tf_gamemovement.cpp b/src/game/shared/tf/tf_gamemovement.cpp index 476601634c2..45dd80c8612 100644 --- a/src/game/shared/tf/tf_gamemovement.cpp +++ b/src/game/shared/tf/tf_gamemovement.cpp @@ -1075,7 +1075,8 @@ void CTFGameMovement::AirDash( void ) CPASFilter filter( m_pTFPlayer->GetAbsOrigin( ) ); params.m_flVolume = 0.1f; params.m_SoundLevel = SNDLVL_25dB; - params.m_nPitch = RemapVal( iAirDash, 1.0f, 5.0f, 100.f, 120.f ); + // prevent too many dashes from getting an overflowed pitch + params.m_nPitch = RemapValClamped( iAirDash, 1.0f, 32.0f, 100.f, 255.f ); params.m_nFlags |= ( SND_CHANGE_PITCH | SND_CHANGE_VOL ); m_pTFPlayer->StopSound( "General.banana_slip" ); m_pTFPlayer->EmitSound( filter, m_pTFPlayer->entindex( ), params );