本文整理汇总了C++中CTFPlayer::IsDormant方法的典型用法代码示例。如果您正苦于以下问题:C++ CTFPlayer::IsDormant方法的具体用法?C++ CTFPlayer::IsDormant怎么用?C++ CTFPlayer::IsDormant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTFPlayer
的用法示例。
在下文中一共展示了CTFPlayer::IsDormant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClientThink
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponMedigun::ClientThink()
{
C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
if ( !pLocalPlayer )
return;
// Don't show it while the player is dead. Ideally, we'd respond to m_bHealing in OnDataChanged,
// but it stops sending the weapon when it's holstered, and it gets holstered when the player dies.
CTFPlayer *pFiringPlayer = ToTFPlayer( GetOwnerEntity() );
if ( !pFiringPlayer || pFiringPlayer->IsPlayerDead() || pFiringPlayer->IsDormant() )
{
ClientThinkList()->SetNextClientThink( GetClientHandle(), CLIENT_THINK_NEVER );
m_bPlayingSound = false;
StopHealSound();
return;
}
// If the local player is the guy getting healed, let him know
// who's healing him, and their charge level.
if( m_hHealingTarget != NULL )
{
if ( pLocalPlayer == m_hHealingTarget )
{
pLocalPlayer->SetHealer( pFiringPlayer, m_flChargeLevel );
}
if ( !m_bPlayingSound )
{
m_bPlayingSound = true;
CLocalPlayerFilter filter;
EmitSound( filter, entindex(), "WeaponMedigun.Healing" );
}
}
if ( m_bOldChargeRelease != m_bChargeRelease )
{
m_bOldChargeRelease = m_bChargeRelease;
ForceHealingTargetUpdate();
}
}