Skip to content

Commit

Permalink
Changed default value to empty string, changed parsing to be inline w…
Browse files Browse the repository at this point in the history
…ith hud_color
  • Loading branch information
chinese-soup committed Jun 9, 2021
1 parent 239dc6a commit e82ae28
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cl_dll/hud_redraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,14 @@ void CHud::UpdateDefaultHUDColor()

void CHud :: GetHudColorsWithAlpha( int &r, int &g, int &b )
{
auto a = 255;
if ( m_pCvarHudAlpha->string && m_pCvarHudAlpha->string[0] )
int a;
if ( sscanf(m_pCvarHudAlpha->string, "%d", &a) == 1)
{
if ( strcmp(m_pCvarHudAlpha->string, "auto") )
{
a = m_pCvarHudAlpha->value;

a = (int) max(a, 1);
a = (int) min(a, 255);
}
a = m_pCvarHudAlpha->value;
a = (int) max(a, 1);
a = (int) min(a, 255);
} else {
a = 255;
}

ScaleColors( r, g, b, a );
Expand Down

0 comments on commit e82ae28

Please sign in to comment.