Fix chat refind skins

This commit is contained in:
Jupeyy 2021-02-15 15:15:21 +01:00
parent 1fb2ef2dfe
commit 00e22d8d14
2 changed files with 7 additions and 20 deletions

View file

@ -877,21 +877,17 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
void CChat::RefindSkins()
{
for(int i = 0; i < MAX_LINES; i++)
for(auto &Line : m_aLines)
{
int r = ((m_CurrentLine - i) + MAX_LINES) % MAX_LINES;
if(m_aLines[r].m_TextContainerIndex == -1)
continue;
if(m_aLines[r].m_HasRenderTee)
if(Line.m_HasRenderTee)
{
const CSkin *pSkin = m_pClient->m_pSkins->Get(m_pClient->m_pSkins->Find(m_aLines[r].m_aSkinName));
if(m_aLines[r].m_CustomColoredSkin)
m_aLines[r].m_RenderSkin = pSkin->m_ColorableSkin;
const CSkin *pSkin = m_pClient->m_pSkins->Get(m_pClient->m_pSkins->Find(Line.m_aSkinName));
if(Line.m_CustomColoredSkin)
Line.m_RenderSkin = pSkin->m_ColorableSkin;
else
m_aLines[r].m_RenderSkin = pSkin->m_OriginalSkin;
Line.m_RenderSkin = pSkin->m_OriginalSkin;
m_aLines[r].m_RenderSkinMetrics = pSkin->m_Metrics;
Line.m_RenderSkinMetrics = pSkin->m_Metrics;
}
}
}

View file

@ -118,15 +118,6 @@ struct CSkin
SSkinMetricVariable m_Body;
SSkinMetricVariable m_Feet;
int m_FeetWidth;
int m_FeetHeight;
int m_FeetOffsetX;
int m_FeetOffsetY;
// these can be used to normalize the metrics
int m_FeetMaxWidth;
int m_FeetMaxHeight;
void Reset()
{
m_Body.Reset();