diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index b23eadc274..e79d8dda63 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -150,6 +150,18 @@ int CHudHealth::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf ) // Returns back a color from the // Green <-> Yellow <-> Red ramp +void CHudHealth::GetHealthColor( int &r, int &g, int &b ) +{ + if( m_iHealth > 25 ) + { + UnpackRGB( r, g, b, gHUD.HUDColor() ); + } + else + { + UnpackRGB( r, g, b, gHUD.HUDColorCritical() ); + } +} + void CHudHealth::GetPainColor( int &r, int &g, int &b ) { #if 0 @@ -166,11 +178,11 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b ) #else if( m_iHealth > 25 ) { - UnpackRGB( r, g, b, gHUD.HUDColor() ); + UnpackRGB( r, g, b, RGB_YELLOWISH ); } else { - UnpackRGB( r, g, b, gHUD.HUDColorCritical() ); + UnpackRGB( r, g, b, RGB_REDISH ); } #endif } @@ -207,7 +219,7 @@ int CHudHealth::Draw( float flTime ) if( m_iHealth <= 15 ) a = 255; - GetPainColor( r, g, b ); + GetHealthColor( r, g, b ); ScaleColors( r, g, b, a ); // Only draw health if we have the suit. diff --git a/cl_dll/health.h b/cl_dll/health.h index 3925fcaa31..f1503289cf 100644 --- a/cl_dll/health.h +++ b/cl_dll/health.h @@ -86,6 +86,7 @@ class CHudHealth : public CHudBase int m_HUD_dmg_bio; int m_HUD_cross; float m_fAttackFront, m_fAttackRear, m_fAttackLeft, m_fAttackRight; + void GetHealthColor( int &r, int &g, int &b ); void GetPainColor( int &r, int &g, int &b ); float m_fFade;