本文整理汇总了C++中CHandle::Detonate方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandle::Detonate方法的具体用法?C++ CHandle::Detonate怎么用?C++ CHandle::Detonate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHandle
的用法示例。
在下文中一共展示了CHandle::Detonate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrimaryAttack
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponHopwire::PrimaryAttack( void )
{
if ( m_bRedraw )
return;
CBaseCombatCharacter *pOwner = GetOwner();
if ( pOwner == NULL )
return;
CBasePlayer *pPlayer = ToBasePlayer( GetOwner() );;
if ( !pPlayer )
return;
// See if we're in trap mode
if ( hopwire_trap.GetBool() && ( m_hActiveHopWire != NULL ) )
{
// Spring the trap
m_hActiveHopWire->Detonate();
m_hActiveHopWire = NULL;
// Don't allow another throw for awhile
m_flTimeWeaponIdle = m_flNextPrimaryAttack = gpGlobals->curtime + 2.0f;
return;
}
// Note that this is a primary attack and prepare the grenade attack to pause.
/*
m_AttackPaused = GRENADE_PAUSED_PRIMARY;
SendWeaponAnim( ACT_VM_PULLBACK_HIGH );
*/
m_AttackPaused = GRENADE_PAUSED_SECONDARY;
SendWeaponAnim( ACT_VM_PULLBACK_LOW );
// Put both of these off indefinitely. We do not know how long
// the player will hold the grenade.
m_flTimeWeaponIdle = FLT_MAX;
m_flNextPrimaryAttack = FLT_MAX;
// If I'm now out of ammo, switch away
/*
if ( !HasPrimaryAmmo() )
{
pPlayer->SwitchToNextBestWeapon( this );
}
*/
}