コード例 #1
0
//-----------------------------------------------------------------------------
// Purpose: Player holding this weapon has started building something
// Assumes we are in a valid build position
//-----------------------------------------------------------------------------
void CTFWeaponBuilder::StartBuilding( void )
{
	CTFPlayer *pPlayer = ToTFPlayer( GetOwner() );
	CBaseObject *pObj = m_hObjectBeingBuilt.Get();

	if ( pPlayer && pPlayer->m_Shared.IsCarryingObject() )
	{
		Assert( pObj );

		pObj->DropCarriedObject( pPlayer );
	}

	Assert( pObj );

	pObj->StartBuilding( GetOwner() );

	m_hObjectBeingBuilt = NULL;

	if ( pPlayer )
	{
		pPlayer->RemoveInvisibility();
	}
}