From 186620a06ef4469a527314f16b6660012297a1df Mon Sep 17 00:00:00 2001 From: kingofings <47538464+kingofings@users.noreply.github.com> Date: Sat, 5 Jul 2025 14:09:47 +0200 Subject: [PATCH 1/2] only remove ammo if 'm_iClip1' is smaller 'GetMaxClip1' --- src/game/shared/tf/tf_weaponbase.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/shared/tf/tf_weaponbase.cpp b/src/game/shared/tf/tf_weaponbase.cpp index d6ca763327f..94700f52937 100644 --- a/src/game/shared/tf/tf_weaponbase.cpp +++ b/src/game/shared/tf/tf_weaponbase.cpp @@ -2090,8 +2090,11 @@ void CTFWeaponBase::IncrementAmmo( void ) { if ( pPlayer && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) > 0 ) { - m_iClip1 = MIN( ( m_iClip1 + 1 ), GetMaxClip1() ); - pPlayer->RemoveAmmo( 1, m_iPrimaryAmmoType ); + if ( m_iClip1 < GetMaxClip1() ) + { + m_iClip1++; + pPlayer->RemoveAmmo( 1, m_iPrimaryAmmoType ); + } } } } From 02b9ad9d44ad446598e4cb083bdad63cc7025c39 Mon Sep 17 00:00:00 2001 From: kingofings <47538464+kingofings@users.noreply.github.com> Date: Sat, 5 Jul 2025 14:23:21 +0200 Subject: [PATCH 2/2] include in previous if --- src/game/shared/tf/tf_weaponbase.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/game/shared/tf/tf_weaponbase.cpp b/src/game/shared/tf/tf_weaponbase.cpp index 94700f52937..c7068ed22a1 100644 --- a/src/game/shared/tf/tf_weaponbase.cpp +++ b/src/game/shared/tf/tf_weaponbase.cpp @@ -2088,13 +2088,10 @@ void CTFWeaponBase::IncrementAmmo( void ) } else if ( !CheckReloadMisfire() ) { - if ( pPlayer && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) > 0 ) + if ( pPlayer && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) > 0 && m_iClip1 < GetMaxClip1() ) { - if ( m_iClip1 < GetMaxClip1() ) - { - m_iClip1++; - pPlayer->RemoveAmmo( 1, m_iPrimaryAmmoType ); - } + m_iClip1++; + pPlayer->RemoveAmmo( 1, m_iPrimaryAmmoType ); } } }