本文整理汇总了C++中CBaseCombatWeapon::DisableIronsights方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatWeapon::DisableIronsights方法的具体用法?C++ CBaseCombatWeapon::DisableIronsights怎么用?C++ CBaseCombatWeapon::DisableIronsights使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatWeapon
的用法示例。
在下文中一共展示了CBaseCombatWeapon::DisableIronsights方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void CHL2MP_Player::PostThink( void )
{
BaseClass::PostThink();
if ( GetFlags() & FL_DUCKING )
{
SetCollisionBounds( VEC_CROUCH_TRACE_MIN, VEC_CROUCH_TRACE_MAX );
}
m_PlayerAnimState.Update();
// Store the eye angles pitch so the client can compute its animation state correctly.
m_angEyeAngles = EyeAngles();
QAngle angles = GetLocalAngles();
angles[PITCH] = 0;
SetLocalAngles( angles );
if (!IsDead())
{
if (m_afButtonReleased & IN_KICK && m_flNextKickAttack < gpGlobals->curtime /* && m_flNextKickAttack < gpGlobals->curtime && !m_bIsKicking*/)
{
KickAttack();
m_bIsKicking = true;
}
}
CBaseCombatWeapon *pWeapon = this->GetActiveWeapon();
if (pWeapon != NULL)
{
if (m_afButtonPressed & IN_IRONSIGHT)
{
pWeapon->EnableIronsights();
}
else if (m_afButtonReleased & IN_IRONSIGHT)
{
pWeapon->DisableIronsights();
}
}
if (!IsDead())
{
if (m_flNextKickAttack < gpGlobals->curtime)
{
m_bIsKicking = false;
CBaseViewModel *vm = GetViewModel(1);
if (vm)
{
int idealSequence = vm->SelectWeightedSequence(ACT_VM_IDLE);
if (idealSequence >= 0)
{
vm->SendViewModelMatchingSequence(idealSequence);
}
}
}
}
}