mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 12:06:07 +08:00
Sync with upstream (Issue #30).
Recompiled tier1 and mathlib for all platforms will come in next commit.
This commit is contained in:
@ -1149,7 +1149,7 @@ float CBaseCombatWeapon::GetViewModelSequenceDuration()
|
||||
return vm->SequenceDuration();
|
||||
}
|
||||
|
||||
bool CBaseCombatWeapon::IsViewModelSequenceFinished( void )
|
||||
bool CBaseCombatWeapon::IsViewModelSequenceFinished( void ) const
|
||||
{
|
||||
// These are not valid activities and always complete immediately
|
||||
if ( GetActivity() == ACT_RESET || GetActivity() == ACT_INVALID )
|
||||
@ -1452,7 +1452,12 @@ selects and deploys each weapon as you pass it. (sjb)
|
||||
bool CBaseCombatWeapon::Deploy( )
|
||||
{
|
||||
MDLCACHE_CRITICAL_SECTION();
|
||||
return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), GetDrawActivity(), (char*)GetAnimPrefix() );
|
||||
bool bResult = DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), GetDrawActivity(), (char*)GetAnimPrefix() );
|
||||
|
||||
// override pose parameters
|
||||
PoseParameterOverride( false );
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
Activity CBaseCombatWeapon::GetDrawActivity( void )
|
||||
@ -1511,6 +1516,9 @@ bool CBaseCombatWeapon::Holster( CBaseCombatWeapon *pSwitchingTo )
|
||||
RescindReloadHudHint();
|
||||
}
|
||||
|
||||
// reset pose parameters
|
||||
PoseParameterOverride( true );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1775,8 +1783,8 @@ void CBaseCombatWeapon::ItemPostFrame( void )
|
||||
|
||||
// -----------------------
|
||||
// Reload pressed / Clip Empty
|
||||
// -----------------------
|
||||
if ( ( pOwner->m_nButtons & IN_RELOAD ) && UsesClipsForAmmo1() && !m_bInReload )
|
||||
// Can only start the Reload Cycle after the firing cycle
|
||||
if ( ( pOwner->m_nButtons & IN_RELOAD ) && m_flNextPrimaryAttack <= gpGlobals->curtime && UsesClipsForAmmo1() && !m_bInReload )
|
||||
{
|
||||
// reload when reload is pressed, or if no buttons are down and weapon is empty.
|
||||
Reload();
|
||||
@ -2440,23 +2448,53 @@ bool CBaseCombatWeapon::IsLocked( CBaseEntity *pAsker )
|
||||
//-----------------------------------------------------------------------------
|
||||
Activity CBaseCombatWeapon::ActivityOverride( Activity baseAct, bool *pRequired )
|
||||
{
|
||||
acttable_t *pTable = ActivityList();
|
||||
int actCount = ActivityListCount();
|
||||
int actCount = 0;
|
||||
acttable_t *pTable = ActivityList( actCount );
|
||||
|
||||
for ( int i = 0; i < actCount; i++, pTable++ )
|
||||
for ( int i = 0; i < actCount; i++ )
|
||||
{
|
||||
if ( baseAct == pTable->baseAct )
|
||||
const acttable_t& act = pTable[i];
|
||||
if ( baseAct == act.baseAct )
|
||||
{
|
||||
if (pRequired)
|
||||
{
|
||||
*pRequired = pTable->required;
|
||||
*pRequired = act.required;
|
||||
}
|
||||
return (Activity)pTable->weaponAct;
|
||||
return (Activity)act.weaponAct;
|
||||
}
|
||||
}
|
||||
return baseAct;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseCombatWeapon::PoseParameterOverride( bool bReset )
|
||||
{
|
||||
CBaseCombatCharacter *pOwner = GetOwner();
|
||||
if ( !pOwner )
|
||||
return;
|
||||
|
||||
CStudioHdr *pStudioHdr = pOwner->GetModelPtr();
|
||||
if ( !pStudioHdr )
|
||||
return;
|
||||
|
||||
int iCount = 0;
|
||||
poseparamtable_t *pPoseParamList = PoseParamList( iCount );
|
||||
if ( pPoseParamList )
|
||||
{
|
||||
for ( int i=0; i<iCount; ++i )
|
||||
{
|
||||
int iPoseParam = pOwner->LookupPoseParameter( pStudioHdr, pPoseParamList[i].pszName );
|
||||
|
||||
if ( iPoseParam != -1 )
|
||||
pOwner->SetPoseParameter( iPoseParam, bReset ? 0 : pPoseParamList[i].flValue );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -2745,6 +2783,13 @@ void* SendProxy_SendNonLocalWeaponDataTable( const SendProp *pProp, const void *
|
||||
}
|
||||
REGISTER_SEND_PROXY_NON_MODIFIED_POINTER( SendProxy_SendNonLocalWeaponDataTable );
|
||||
|
||||
#else
|
||||
void CBaseCombatWeapon::RecvProxy_WeaponState( const CRecvProxyData *pData, void *pStruct, void *pOut )
|
||||
{
|
||||
CBaseCombatWeapon *pWeapon = (CBaseCombatWeapon*)pStruct;
|
||||
pWeapon->m_iState = pData->m_Value.m_Int;
|
||||
pWeapon->UpdateVisibility();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PREDICTION_ERROR_CHECK_LEVEL > 1
|
||||
@ -2818,7 +2863,7 @@ BEGIN_NETWORK_TABLE(CBaseCombatWeapon, DT_BaseCombatWeapon)
|
||||
RecvPropDataTable("LocalActiveWeaponData", 0, 0, &REFERENCE_RECV_TABLE(DT_LocalActiveWeaponData)),
|
||||
RecvPropInt( RECVINFO(m_iViewModelIndex)),
|
||||
RecvPropInt( RECVINFO(m_iWorldModelIndex)),
|
||||
RecvPropInt( RECVINFO(m_iState )),
|
||||
RecvPropInt( RECVINFO(m_iState), 0, &CBaseCombatWeapon::RecvProxy_WeaponState ),
|
||||
RecvPropEHandle( RECVINFO(m_hOwner ) ),
|
||||
#endif
|
||||
END_NETWORK_TABLE()
|
||||
|
Reference in New Issue
Block a user