Use IsOtherTeam for nameplates too

This commit is contained in:
trml 2019-07-16 22:34:18 +02:00
parent ddfcb62caa
commit cd64204358

View file

@ -28,7 +28,6 @@ void CNamePlates::RenderNameplate(
)
{
int ClientID = pPlayerInfo->m_ClientID;
bool Local = m_pClient->m_Snap.m_LocalClientID == ClientID;
vec2 Position;
if(ClientID >= 0 && ClientID < MAX_CLIENTS)
@ -36,17 +35,7 @@ void CNamePlates::RenderNameplate(
else
Position = mix(vec2(pPrevChar->m_X, pPrevChar->m_Y), vec2(pPlayerChar->m_X, pPlayerChar->m_Y), Client()->IntraGameTick());
bool OtherTeam = false;
if((m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) || ClientID < 0)
OtherTeam = false;
else if(m_pClient->m_Snap.m_SpecInfo.m_Active && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW)
OtherTeam = m_pClient->m_Teams.Team(ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID);
else if((m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Solo || m_pClient->m_aClients[ClientID].m_Solo) && !Local)
OtherTeam = true;
else
OtherTeam = m_pClient->m_Teams.Team(ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientID);
bool OtherTeam = m_pClient->IsOtherTeam(ClientID);
float FontSize = 18.0f + 20.0f * g_Config.m_ClNameplatesSize / 100.0f;
float FontSizeClan = 18.0f + 20.0f * g_Config.m_ClNameplatesClanSize / 100.0f;