本文整理汇总了C++中CHandle::BumpWeapon方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandle::BumpWeapon方法的具体用法?C++ CHandle::BumpWeapon怎么用?C++ CHandle::BumpWeapon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHandle
的用法示例。
在下文中一共展示了CHandle::BumpWeapon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAnimEvent
//-----------------------------------------------------------------------------
// Purpose: Catches the monster-specific messages that occur when tagged
// animation frames are played.
// Input : *pEvent -
//-----------------------------------------------------------------------------
void CItem_AmmoCrate::HandleAnimEvent( animevent_t *pEvent )
{
if ( pEvent->event == AE_AMMOCRATE_PICKUP_AMMO )
{
if ( m_hActivator )
{
if ( m_pGiveWeapon[m_nAmmoType] && !m_hActivator->Weapon_OwnsThisType( m_pGiveWeapon[m_nAmmoType] ) )
{
CBaseEntity *pEntity = CreateEntityByName( m_pGiveWeapon[m_nAmmoType] );
CBaseCombatWeapon *pWeapon = dynamic_cast<CBaseCombatWeapon*>(pEntity);
if ( pWeapon )
{
pWeapon->SetAbsOrigin( m_hActivator->GetAbsOrigin() );
pWeapon->m_iPrimaryAmmoType = 0;
pWeapon->m_iSecondaryAmmoType = 0;
pWeapon->Spawn();
if ( !m_hActivator->BumpWeapon( pWeapon ) )
{
UTIL_Remove( pEntity );
}
else
{
SetBodygroup( 1, false );
}
}
}
if ( m_hActivator->GiveAmmo( m_nAmmoAmounts[m_nAmmoType], m_nAmmoIndex ) != 0 )
{
SetBodygroup( 1, false );
}
m_hActivator = NULL;
}
return;
}
BaseClass::HandleAnimEvent( pEvent );
}