game: shared: Implement "mod_medic_buff_range" attribute

This attribute allows user to modify The Amputator's healing radius.
This commit is contained in:
SanyaSho 2025-05-21 22:54:02 +03:00
parent 39f6dde8fb
commit ceff9d7d17
1 changed files with 5 additions and 1 deletions

View File

@ -14187,6 +14187,10 @@ void CTFPlayerShared::PulseMedicRadiusHeal( void )
#ifdef GAME_DLL
if ( gpGlobals->curtime >= m_flRadiusHealCheckTime )
{
float fMaxRadius = 450.0f;
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( m_pOuter, fMaxRadius, mod_medic_buff_range );
const float fMaxRadiusSq = fMaxRadius * fMaxRadius;
for( int iPlayerIndex = 1; iPlayerIndex <= MAX_PLAYERS; ++iPlayerIndex )
{
CTFPlayer *pTFPlayer = ToTFPlayer( UTIL_PlayerByIndex( iPlayerIndex ) );
@ -14217,7 +14221,7 @@ void CTFPlayerShared::PulseMedicRadiusHeal( void )
}
Vector vDist = pTFPlayer->GetAbsOrigin() - m_pOuter->GetAbsOrigin();
if ( vDist.LengthSqr() <= 450 * 450 )
if ( vDist.LengthSqr() <= fMaxRadiusSq )
{
// Ignore players we can't see
trace_t trace;