mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Extract CTeeRenderInfo::Valid
function
This commit is contained in:
parent
4cb0bb2744
commit
cb0af02eae
|
@ -230,7 +230,7 @@ void CInfoMessages::OnTeamKillMessage(const CNetMsg_Sv_KillMsgTeam *pMsg)
|
|||
bool KillMsgValid = true;
|
||||
for(int i = 0; i < Kill.m_TeamSize; i++)
|
||||
{
|
||||
KillMsgValid = KillMsgValid && Kill.m_aVictimIds[i] >= 0 && ((Kill.m_aVictimRenderInfo[i].m_CustomColoredSkin && Kill.m_aVictimRenderInfo[i].m_ColorableRenderSkin.m_Body.IsValid()) || (!Kill.m_aVictimRenderInfo[i].m_CustomColoredSkin && Kill.m_aVictimRenderInfo[i].m_OriginalRenderSkin.m_Body.IsValid()));
|
||||
KillMsgValid = KillMsgValid && Kill.m_aVictimIds[i] >= 0 && Kill.m_aVictimRenderInfo[i].Valid();
|
||||
}
|
||||
|
||||
if(KillMsgValid)
|
||||
|
@ -296,9 +296,7 @@ void CInfoMessages::OnKillMessage(const CNetMsg_Sv_KillMsg *pMsg)
|
|||
|
||||
CreateNamesIfNotCreated(&Kill);
|
||||
|
||||
bool KillMsgValid = (Kill.m_aVictimRenderInfo[0].m_CustomColoredSkin && Kill.m_aVictimRenderInfo[0].m_ColorableRenderSkin.m_Body.IsValid()) || (!Kill.m_aVictimRenderInfo[0].m_CustomColoredSkin && Kill.m_aVictimRenderInfo[0].m_OriginalRenderSkin.m_Body.IsValid());
|
||||
KillMsgValid &= Kill.m_KillerID == -1 || ((Kill.m_KillerRenderInfo.m_CustomColoredSkin && Kill.m_KillerRenderInfo.m_ColorableRenderSkin.m_Body.IsValid()) || (!Kill.m_KillerRenderInfo.m_CustomColoredSkin && Kill.m_KillerRenderInfo.m_OriginalRenderSkin.m_Body.IsValid()));
|
||||
if(KillMsgValid)
|
||||
if(Kill.m_aVictimRenderInfo[0].Valid() && (Kill.m_KillerID == -1 || Kill.m_KillerRenderInfo.Valid()))
|
||||
{
|
||||
AddInfoMsg(EType::TYPE_KILL, Kill);
|
||||
}
|
||||
|
|
|
@ -62,6 +62,11 @@ public:
|
|||
bool m_GotAirJump;
|
||||
int m_TeeRenderFlags;
|
||||
bool m_FeetFlipped;
|
||||
|
||||
bool Valid() const
|
||||
{
|
||||
return m_CustomColoredSkin ? m_ColorableRenderSkin.m_Body.IsValid() : m_OriginalRenderSkin.m_Body.IsValid();
|
||||
}
|
||||
};
|
||||
|
||||
// Tee Render Flags
|
||||
|
|
Loading…
Reference in a new issue