Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/game/client/tf/tf_hud_spectator_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ void CTFHudSpectatorExtras::OnTick()
return;
}

bool bLocalPlayerIsAlive = pLocalPlayer->IsAlive();
bool bLocalPlayerTeamGlows = bLocalPlayerIsAlive && pLocalPlayer->m_Shared.InCond( TF_COND_TEAM_GLOWS );

if ( nLocalPlayerTeam >= FIRST_GAME_TEAM )
{
if ( pLocalPlayer->IsAlive() && !pLocalPlayer->m_Shared.InCond( TF_COND_TEAM_GLOWS ) )
if ( bLocalPlayerIsAlive && !bLocalPlayerTeamGlows )
{
if ( m_vecEntitiesToDraw.Count() > 0 )
{
Expand All @@ -132,7 +135,7 @@ void CTFHudSpectatorExtras::OnTick()
}

if ( bIsHLTV ||
( tf_spec_xray.GetBool() && ( ( nLocalPlayerTeam == TEAM_SPECTATOR ) || ( pLocalPlayer->GetObserverMode() > OBS_MODE_FREEZECAM ) || ( pLocalPlayer->m_Shared.InCond( TF_COND_TEAM_GLOWS ) && tf_enable_glows_after_respawn.GetBool() ) ) ) )
( tf_spec_xray.GetBool() && ( ( nLocalPlayerTeam == TEAM_SPECTATOR ) || ( pLocalPlayer->GetObserverMode() > OBS_MODE_FREEZECAM ) || ( bLocalPlayerTeamGlows && tf_enable_glows_after_respawn.GetBool() ) ) ) )
{
bool bShowEveryone = ( bIsHLTV ||
( ( nLocalPlayerTeam == TEAM_SPECTATOR ) && tf_spec_xray.GetBool() ) ||
Expand Down Expand Up @@ -163,7 +166,8 @@ void CTFHudSpectatorExtras::OnTick()
( pPlayer->m_Shared.IsStealthed() && ( nLocalPlayerTeam >= FIRST_GAME_TEAM ) && ( nPlayerTeamNumber != nLocalPlayerTeam ) ) ||
( !bShowEveryone && !pPlayer->IsPlayerClass( TF_CLASS_SPY ) && ( nPlayerTeamNumber != nLocalPlayerTeam ) ) ||
( !bShowEveryone && pPlayer->IsPlayerClass( TF_CLASS_SPY ) && !pPlayer->m_Shared.InCond( TF_COND_DISGUISED ) && ( nPlayerTeamNumber != nLocalPlayerTeam ) ) ||
( !bShowEveryone && pPlayer->IsPlayerClass( TF_CLASS_SPY ) && pPlayer->m_Shared.InCond( TF_COND_DISGUISED ) && ( nPlayerTeamNumber != nLocalPlayerTeam ) && ( pPlayer->m_Shared.GetDisguiseTeam() != nLocalPlayerTeam ) ) )
( !bShowEveryone && pPlayer->IsPlayerClass( TF_CLASS_SPY ) && pPlayer->m_Shared.InCond( TF_COND_DISGUISED ) && ( nPlayerTeamNumber != nLocalPlayerTeam ) && ( pPlayer->m_Shared.GetDisguiseTeam() != nLocalPlayerTeam ) ) ||
( !bShowEveryone && bLocalPlayerTeamGlows && ( ( nPlayerTeamNumber != nLocalPlayerTeam ) || pLocalPlayer->IsLineOfSightClear( pPlayer, CBaseCombatCharacter::IGNORE_ACTORS ) ) ) )
{
if ( pPlayer->IsClientSideGlowEnabled() )
{
Expand Down Expand Up @@ -193,7 +197,7 @@ void CTFHudSpectatorExtras::OnTick()

// don't draw their name if we're currently spectating them, but we still want them to glow
m_vecEntitiesToDraw[nVecIndex].m_bDrawName = true;
if ( !pLocalPlayer->IsAlive() )
if ( !bLocalPlayerIsAlive )
{
CSpectatorTargetID *pSpecTargetID = (CSpectatorTargetID *)GET_HUDELEMENT( CSpectatorTargetID );
if ( ( pLocalPlayer->GetObserverTarget() == pPlayer ) || ( pSpecTargetID && pSpecTargetID->GetTargetIndex() == i ) )
Expand Down