From 1f2f268173717215c27e626d6c301bf1026307f1 Mon Sep 17 00:00:00 2001 From: tyabus Date: Mon, 27 May 2019 18:07:17 +0300 Subject: [PATCH] Add deny noise for func_recharger and func_healthcharger, when activator's health/armor is full --- dlls/h_battery.cpp | 2 +- dlls/healthkit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index 976a5733..7b8182b3 100644 --- a/dlls/h_battery.cpp +++ b/dlls/h_battery.cpp @@ -116,7 +116,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use } // if the player doesn't have the suit, or there is no juice left, make the deny noise - if( ( m_iJuice <= 0 ) || ( !( pActivator->pev->weapons & ( 1 << WEAPON_SUIT ) ) ) ) + if( ( m_iJuice <= 0 ) || ( !( pActivator->pev->weapons & ( 1 << WEAPON_SUIT ) ) ) || ( pActivator->pev->armorvalue == 100 ) ) { if( m_flSoundTime <= gpGlobals->time ) { diff --git a/dlls/healthkit.cpp b/dlls/healthkit.cpp index 99d53d35..cef99747 100644 --- a/dlls/healthkit.cpp +++ b/dlls/healthkit.cpp @@ -187,7 +187,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u } // if the player doesn't have the suit, or there is no juice left, make the deny noise - if( ( m_iJuice <= 0 ) || ( !( pActivator->pev->weapons & ( 1 << WEAPON_SUIT ) ) ) ) + if( ( m_iJuice <= 0 ) || ( !( pActivator->pev->weapons & ( 1 << WEAPON_SUIT ) ) ) || ( pActivator->pev->health == 100 ) ) { if( m_flSoundTime <= gpGlobals->time ) {