示例#1
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int	CBaseCombatWeapon::ObjectCaps( void )
{ 
	int caps = BaseClass::ObjectCaps();
	if ( !IsFollowingEntity() && !HasSpawnFlags(SF_WEAPON_NO_PLAYER_PICKUP) )
	{
		caps |= FCAP_IMPULSE_USE;
	}

	return caps;
}
void CStickyBomb::SetBombOrigin()
{
	if ( IsFollowingEntity() )
	{
		CBaseAnimating *pOtherAnim = dynamic_cast<CBaseAnimating *>(GetFollowedEntity());
		if ( pOtherAnim )
		{
			Vector origin;
			matrix3x4_t boneToWorld;
			pOtherAnim->GetBoneTransform( m_boneIndexAttached, boneToWorld );
			VectorTransform( m_bonePosition, boneToWorld, origin );
			StopFollowingEntity( );
			SetMoveType(MOVETYPE_NONE);
			SetAbsOrigin( origin );
		}
	}
}