mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-09 03:24:52 +00:00
Merge 9a766bfcb8
into 0565403b15
This commit is contained in:
commit
037c38e376
4 changed files with 21 additions and 5 deletions
|
@ -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; }
|
||||
|
|
|
@ -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++ )
|
||||
|
|
|
@ -482,6 +482,7 @@ public:
|
|||
bool ShouldShowNemesisIcon();
|
||||
|
||||
virtual IMaterial *GetHeadLabelMaterial( void );
|
||||
virtual bool ShouldShowHeadLabel();
|
||||
|
||||
// Spy Cigarette
|
||||
bool CanLightCigarette( void );
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue