Skip to content

Commit

Permalink
v3.0 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RezWaki authored Apr 25, 2020
1 parent 64ee5b6 commit d905a32
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cl_dll/health.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,15 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b )
#else
if (m_iHealth > 25)
{
UnpackRGB(r,g,b, RGB_YELLOWISH);
//UnpackRGB(r,g,b, RGB_YELLOWISH);
}
else
{
r = 250;
g = 0;
b = 0;
}
sscanf(CVAR_GET_STRING("cl_hudcolor"), "%i %i %i", &r, &g, &b );
#endif
}

Expand Down Expand Up @@ -240,12 +241,11 @@ int CHudHealth::Draw(float flTime)

if ( (gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH) || gEngfuncs.IsSpectateOnly() )
return 1;
if( !CVAR_GET_FLOAT("cl_newhud") ) {
if ( !m_SpriteHandle_t )
m_SpriteHandle_t = LoadSprite(PAIN_NAME);

if( !CVAR_GET_FLOAT("cl_newhud") ) {
// Has health changed? Flash the health #
if (m_fFade)
/*if (m_fFade)
{
m_fFade -= (gHUD.m_flTimeDelta * 20);
if (m_fFade <= 0)
Expand All @@ -260,11 +260,11 @@ int CHudHealth::Draw(float flTime)
}
else
a = MIN_ALPHA;
a = MIN_ALPHA;*/

// If health is getting low, make it bright red
if (m_iHealth <= 15)
a = 255;
//if (m_iHealth <= 15)
// a = 255;

GetPainColor( r, g, b );
ScaleColors(r, g, b, a );
Expand All @@ -291,9 +291,8 @@ int CHudHealth::Draw(float flTime)
int iWidth = HealthWidth/10;
FillRGBA(x, y, iWidth, iHeight, pHudColors[0], pHudColors[1], pHudColors[2], pHudColors[3]);
}

DrawDamage(flTime);
}
DrawDamage(flTime);
return DrawPain(flTime);
}

Expand Down

0 comments on commit d905a32

Please sign in to comment.