Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CClientWeapon::PopulateCreateStruct( ObjectCreateStruct *pOCS ) const
- {
- // sanity check parameters
- ASSERT( 0 != pOCS );
- // sanity check globals
- ASSERT( 0 != g_pModelButeMgr );
- ASSERT( 0 != g_pCommonLT );
- ASSERT( 0 != g_pLTClient );
- ASSERT( 0 != g_pPlayerMgr );
- // sanity check this object
- ASSERT( 0 != m_pWeapon );
- // get the model filename
- SAFE_STRCPY( pOCS->m_Filename, m_pWeapon->szPVModel );
- // add the skins
- m_pWeapon->blrPVSkins.CopyList( 0, pOCS->m_SkinNames[0], ( MAX_CS_FILENAME_LEN + 1 ) );
- // add the render styles
- m_pWeapon->blrPVRenderStyles.CopyList( 0, pOCS->m_RenderStyleNames[ 0 ], ( MAX_CS_FILENAME_LEN + 1 ) );
- // Figure out what hand skin to use...
- ASSERT( g_pPlayerMgr->GetMoveMgr() );
- CCharacterFX* pCharFX = g_pPlayerMgr->GetMoveMgr()->GetCharacterFX();
- if ( ( m_pWeapon->blrPVSkins.GetNumItems() ) &&
- ( 0 == strcmp( m_pWeapon->blrPVSkins.GetItem( 0 ), "Hands" ) ) )
- {
- // This looks for the special case where "Hands" is specified as the first
- // player view skin. If it is, then we take the skin from the model bute
- // instead of the weapon bute.
- ModelId nModelID = ( pCharFX ) ? pCharFX->GetModelId() : static_cast< ModelId >( 0 );
- SAFE_STRCPY( pOCS->m_SkinNames[ 0 ], g_pModelButeMgr->GetHandsSkinFilename( nModelID ) );
- }
- // Create the weapon at it's actual position...
- LTVector vWeaponOffset = GetWeaponOffset();
- pOCS->m_Pos.x = vWeaponOffset.x + m_fBobWidth;
- pOCS->m_Pos.y = vWeaponOffset.y + m_fBobHeight;
- pOCS->m_Pos.z = vWeaponOffset.z;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement