Skip to content

Commit

Permalink
hud_rainbow: disable draw rainbow color player names in spectator mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Elinsrc committed Aug 15, 2024
1 parent 826a842 commit 84f68cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cl_dll/hud_redraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ int CHud::DrawTextCentered(int x, int y, const char* szString, int r, int g, int
if ( !szString )
return 1;

int width = DrawHudStringLen(szString);
int width = GetHudStringWidth(szString);
x += DrawText(x - width / 2, y, szString, r, g, b);
return x;
}
2 changes: 2 additions & 0 deletions cl_dll/hud_spectator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,10 @@ int CHudSpectator::Draw( float flTime )

lx = strlen( string ) * 3; // 3 is avg. character length :)

gHUD.m_Rainbow.PushDisable();
DrawSetTextColor( color[0], color[1], color[2] );
DrawConsoleString( m_vPlayerPos[i][0] - lx,m_vPlayerPos[i][1], string );
gHUD.m_Rainbow.PopDisable();
}

return 1;
Expand Down

0 comments on commit 84f68cb

Please sign in to comment.