Skip to content

Commit

Permalink
Make skin refind bit more aggressive
Browse files Browse the repository at this point in the history
  • Loading branch information
Jupeyy committed Sep 10, 2023
1 parent 62c0d34 commit 47addc4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/game/client/components/chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,10 @@ void CChat::RefindSkins()

Line.m_RenderSkinMetrics = pSkin->m_Metrics;
}
else
{
Line.m_RenderSkin.Reset();
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/game/client/components/ghost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,15 +675,19 @@ void CGhost::RefindSkin()
if(!Ghost.Empty())
{
IntsToStr(&Ghost.m_Skin.m_Skin0, 6, aSkinName);
CTeeRenderInfo *pRenderInfo = &Ghost.m_RenderInfo;
if(aSkinName[0] != '\0')
{
CTeeRenderInfo *pRenderInfo = &Ghost.m_RenderInfo;

const CSkin *pSkin = m_pClient->m_Skins.Find(aSkinName);
pRenderInfo->m_OriginalRenderSkin = pSkin->m_OriginalSkin;
pRenderInfo->m_ColorableRenderSkin = pSkin->m_ColorableSkin;
pRenderInfo->m_SkinMetrics = pSkin->m_Metrics;
}
else
{
pRenderInfo->m_OriginalRenderSkin.Reset();
pRenderInfo->m_ColorableRenderSkin.Reset();
}
}
}
if(!m_CurGhost.Empty())
Expand Down
1 change: 1 addition & 0 deletions src/game/client/components/killmessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ void CKillMessages::RefindSkins()

if(m_aKillmsgs[r].m_KillerID >= 0)
{
m_aKillmsgs[r].m_KillerRenderInfo = {};
const CGameClient::CClientData &Client = GameClient()->m_aClients[m_aKillmsgs[r].m_KillerID];
if(Client.m_aSkinName[0] != '\0')
m_aKillmsgs[r].m_KillerRenderInfo = Client.m_RenderInfo;
Expand Down
5 changes: 5 additions & 0 deletions src/game/client/gameclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3343,6 +3343,11 @@ void CGameClient::RefindSkins()
Client.m_SkinInfo.m_ColorableRenderSkin = pSkin->m_ColorableSkin;
Client.UpdateRenderInfo(IsTeamPlay());
}
else
{
Client.m_SkinInfo.m_OriginalRenderSkin.Reset();
Client.m_SkinInfo.m_ColorableRenderSkin.Reset();
}
}
m_Ghost.RefindSkin();
m_Chat.RefindSkins();
Expand Down

0 comments on commit 47addc4

Please sign in to comment.