@@ -2181,13 +2181,45 @@ void CTFPlayerShared::OnConditionRemoved( ETFCond eCond )
21812181 }
21822182}
21832183
2184+ // FIXME: copied from tf_weapon_medigun... move to a common place
2185+ float GetOverhealBonus ( float flOverheal, float flMod )
2186+ {
2187+ // Handle bonuses as additive, penalties as percentage...
2188+ float flOverhealBonus = flOverheal - 1 .0f ;
2189+ if ( flMod >= 1 .0f )
2190+ {
2191+ flOverhealBonus += flMod;
2192+ }
2193+ else if ( flMod < 1 .0f && flOverhealBonus > 0 .0f )
2194+ {
2195+ flOverhealBonus *= flMod;
2196+ flOverhealBonus += 1 .0f ;
2197+ }
2198+
2199+ // Safety net
2200+ if ( flOverhealBonus <= 1 .0f )
2201+ {
2202+ flOverhealBonus = 1 .0f ;
2203+ }
2204+
2205+ return flOverhealBonus;
2206+ }
2207+
21842208// -----------------------------------------------------------------------------
21852209// Purpose: Returns the overheal bonus the specified healer is capable of buffing to
21862210// -----------------------------------------------------------------------------
21872211int CTFPlayerShared::GetMaxBuffedHealth ( bool bIgnoreAttributes /* = false*/ , bool bIgnoreHealthOverMax /* = false*/ )
21882212{
2213+ float flPatientOverheal = 1 .0f ;
2214+ if ( !bIgnoreAttributes )
2215+ {
2216+ CALL_ATTRIB_HOOK_FLOAT_ON_OTHER ( m_pOuter, flPatientOverheal, mult_patient_overheal_penalty );
2217+ // TODO: active
2218+ CALL_ATTRIB_HOOK_FLOAT_ON_OTHER ( m_pOuter, flPatientOverheal, mult_patient_overheal_penalty_active );
2219+ }
2220+
21892221 // Find the healer we have who's providing the most overheal
2190- float flBoostMax = m_pOuter->GetMaxHealthForBuffing () * tf_max_health_boost.GetFloat ();
2222+ float flBoostMax = m_pOuter->GetMaxHealthForBuffing () * GetOverhealBonus ( tf_max_health_boost.GetFloat (), flPatientOverheal );
21912223#ifdef GAME_DLL
21922224 if ( !bIgnoreAttributes )
21932225 {
0 commit comments