Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
[client] Fix division by zero in CHud::GetHudAmmoColor
Browse files Browse the repository at this point in the history
  • Loading branch information
tmp64 committed May 20, 2019
1 parent 6da1de1 commit 0c017c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cl_dll/CHud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ void CHud::GetHudColor( int hudPart, int value, int &r, int &g, int &b )
void CHud::GetHudAmmoColor(int value, int maxvalue, int &r, int &g, int &b)
{
RGBA *c;
if (maxvalue == -1) // if you are using custom weapons, then default colors are going to be used....
if (maxvalue == -1 || maxvalue == 0) // if you are using custom weapons, then default colors are going to be used....
{
ParseColor(m_pCvarColor->string, m_hudColor); c = &m_hudColor;
}
Expand Down

0 comments on commit 0c017c0

Please sign in to comment.