From 47addc4175b17024bd40c5688ec0b883882104d2 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Sun, 10 Sep 2023 17:26:58 +0200 Subject: [PATCH] Make skin refind bit more aggressive --- src/game/client/components/chat.cpp | 4 ++++ src/game/client/components/ghost.cpp | 8 ++++++-- src/game/client/components/killmessages.cpp | 1 + src/game/client/gameclient.cpp | 5 +++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index ead69b10b..b5c875595 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -817,6 +817,10 @@ void CChat::RefindSkins() Line.m_RenderSkinMetrics = pSkin->m_Metrics; } + else + { + Line.m_RenderSkin.Reset(); + } } } diff --git a/src/game/client/components/ghost.cpp b/src/game/client/components/ghost.cpp index 1a14e91a0..e1f007c8a 100644 --- a/src/game/client/components/ghost.cpp +++ b/src/game/client/components/ghost.cpp @@ -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()) diff --git a/src/game/client/components/killmessages.cpp b/src/game/client/components/killmessages.cpp index 3f4881912..212c7293c 100644 --- a/src/game/client/components/killmessages.cpp +++ b/src/game/client/components/killmessages.cpp @@ -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; diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 705eb1838..72c1d8591 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -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();