From 5cc9ec9cbe78ada22c9c826a69e156bc44a5664b Mon Sep 17 00:00:00 2001 From: Adam Willden Date: Sat, 17 Oct 2020 20:17:48 +0100 Subject: [PATCH] temp --- cl_dll/ff/vgui/ff_quantityitem.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/cl_dll/ff/vgui/ff_quantityitem.cpp b/cl_dll/ff/vgui/ff_quantityitem.cpp index 17fcb3ac9..56ddc99cd 100644 --- a/cl_dll/ff/vgui/ff_quantityitem.cpp +++ b/cl_dll/ff/vgui/ff_quantityitem.cpp @@ -614,10 +614,13 @@ namespace vgui } } - void FFQuantityItem::SetBarColor( Color newBarColor ) - { - m_clrBarCustomColor = newBarColor; - RecalculateColor(m_ColorBar, m_iBarColorMode, m_clrBarCustomColor); + void FFQuantityItem::SetBarColor( Color newBarColor ) + { + if(m_clrBarCustomColor != newBarColor) + { + m_clrBarCustomColor = newBarColor; + RecalculateColor(m_ColorBar, m_iBarColorMode, m_clrBarCustomColor); + } } void FFQuantityItem::SetBarBorderColor( Color newBarBorderColor ) @@ -1005,15 +1008,9 @@ namespace vgui SetBarColorMode(iColorMode); } - bool bValidColor = false; - Color color = Color(iRed, iGreen, iBlue, iAlpha); if(iRed != -1 && iGreen != -1 && iBlue != -1 && iAlpha != -1) { - bValidColor = true; - } - - if(m_clrBarCustomColor != color && bValidColor) - { + Color color = Color(iRed, iGreen, iBlue, iAlpha); SetBarColor(color); } }