This commit is contained in:
ficool2 2025-04-03 19:41:06 +03:00 committed by GitHub
commit 037c38e376
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 5 deletions

View file

@ -372,7 +372,8 @@ public:
bool HintMessage( int hint, bool bForce = false, bool bOnlyIfClear = false ) { return Hints() ? Hints()->HintMessage( hint, bForce, bOnlyIfClear ) : false; }
void HintMessage( const char *pMessage ) { if (Hints()) Hints()->HintMessage( pMessage ); }
virtual IMaterial *GetHeadLabelMaterial( void );
virtual IMaterial *GetHeadLabelMaterial( void );
virtual bool ShouldShowHeadLabel() { return !IsPlayerDead(); }
// Fog
fogparams_t *GetFogParams( void ) { return &m_CurrentFog; }

View file

@ -9431,7 +9431,17 @@ IMaterial *C_TFPlayer::GetHeadLabelMaterial( void )
if ( g_pHeadLabelMaterial[0] == NULL )
SetupHeadLabelMaterials();
if ( GetTeamNumber() == TF_TEAM_RED )
int nTeam;
if ( m_Shared.InCond( TF_COND_DISGUISED ) && IsEnemyPlayer() )
{
nTeam = m_Shared.GetDisguiseTeam();
}
else
{
nTeam = GetTeamNumber();
}
if ( nTeam == TF_TEAM_RED )
{
return g_pHeadLabelMaterial[TF_PLAYER_HEAD_LABEL_RED];
}
@ -9443,6 +9453,11 @@ IMaterial *C_TFPlayer::GetHeadLabelMaterial( void )
return BaseClass::GetHeadLabelMaterial();
}
bool C_TFPlayer::ShouldShowHeadLabel()
{
return BaseClass::ShouldShowHeadLabel() && ( !m_Shared.IsStealthed() || !IsEnemyPlayer() );
}
void SetupHeadLabelMaterials( void )
{
for ( int i = 0; i < 2; i++ )

View file

@ -482,6 +482,7 @@ public:
bool ShouldShowNemesisIcon();
virtual IMaterial *GetHeadLabelMaterial( void );
virtual bool ShouldShowHeadLabel();
// Spy Cigarette
bool CanLightCigarette( void );

View file

@ -227,11 +227,10 @@ void CVoiceStatus::DrawHeadLabels()
continue;
C_BasePlayer *pPlayer = dynamic_cast<C_BasePlayer*>(pClient);
if( !pPlayer )
if ( !pPlayer )
continue;
// Don't show an icon for dead or spectating players (ie: invisible entities).
if( pPlayer->IsPlayerDead() )
if ( !pPlayer->ShouldShowHeadLabel() )
continue;
// Place it 20 units above his head.