From 0633ba0a1d47735aa58f8f7ac2f8d6008909e81b Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Fri, 12 Jul 2024 12:29:57 -0500 Subject: [PATCH] split reciprocal --- src/game/client/swarm/rd_collections_equipment.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game/client/swarm/rd_collections_equipment.cpp b/src/game/client/swarm/rd_collections_equipment.cpp index db93052ee..38ffdf17d 100644 --- a/src/game/client/swarm/rd_collections_equipment.cpp +++ b/src/game/client/swarm/rd_collections_equipment.cpp @@ -938,13 +938,18 @@ void CRD_Equipment_WeaponFact::ApplySchemeSettings( vgui::IScheme *pScheme ) if ( bShowReciprocal ) { - flBaseValue += flSkillValue; - flSkillValue = 0.0f; + float flTotalValue = flBaseValue + flSkillValue; + if ( flTotalValue != 0.0f ) + { + flTotalValue = 1.0f / flTotalValue; + } if ( flBaseValue != 0.0f ) { flBaseValue = 1.0f / flBaseValue; } + + flSkillValue = flTotalValue - flBaseValue; } int iPrecision = m_pFact->Precision;