Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions src/game/client/tf/c_tf_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8393,10 +8393,12 @@ void BuildBigHeadTransformations( CBaseAnimating *pObject, CStudioHdr *hdr, Vect
// Scale the head.
MatrixScaleBy ( flScale, transform );

const int cMaxNumHelms = 2;
const int cMaxNumHelms = 4;
int iHelmIndex[cMaxNumHelms];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it is time to rename these variables.

iHelmIndex[0] = pObject->LookupBone( "prp_helmet" );
iHelmIndex[1] = pObject->LookupBone( "prp_hat" );
iHelmIndex[2] = pObject->LookupBone( "prp_cig" );
iHelmIndex[3] = pObject->LookupBone( "prp_glasses" );

for ( int i = 0; i < cMaxNumHelms; i++ )
{
Expand Down Expand Up @@ -8443,6 +8445,20 @@ void BuildDecapitatedTransformations( CBaseAnimating *pObject, CStudioHdr *hdr,
matrix3x4_t &transformhelmet = pObject->GetBoneForWrite( iHelm );
MatrixScaleByZero ( transformhelmet );
}

iHelm = pObject->LookupBone( "prp_cig" );
if ( iHelm != -1 )
{
matrix3x4_t &transformhelmet = pObject->GetBoneForWrite( iHelm );
MatrixScaleByZero ( transformhelmet );
}

iHelm = pObject->LookupBone( "prp_glasses" );
if ( iHelm != -1 )
{
matrix3x4_t &transformhelmet = pObject->GetBoneForWrite( iHelm );
MatrixScaleByZero ( transformhelmet );
}
}


Expand Down Expand Up @@ -8485,6 +8501,16 @@ void BuildNeckScaleTransformations( CBaseAnimating *pObject, CStudioHdr *hdr, Ve
}
}

if ( iClass == TF_CLASS_MEDIC )
{
int iGlasses = pObject->LookupBone( "prp_glasses" );
if ( iGlasses != -1 )
{
matrix3x4_t &glasses_transform = pObject->GetBoneForWrite( iGlasses );
MatrixScaleByZero ( glasses_transform );
}
}

// Compress the head into the neck.
int iHead = pObject->LookupBone( "bip_head" );
if ( iHead != -1 )
Expand Down Expand Up @@ -8542,7 +8568,7 @@ void AppendChildren_R( CUtlVector< const mstudiobone_t * > *pChildBones, const s
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void BuildTorsoScaleTransformations( CBaseAnimating *pObject, CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed, float flScale, int iClass )
void BuildTorsoScaleTransformations( CBaseAnimating *pObject, CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed, float flScale )
{
if ( !pObject || flScale == 1.f )
return;
Expand Down Expand Up @@ -8711,7 +8737,7 @@ void C_TFPlayer::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion
m_BoneAccessor.SetWritableBones( BONE_USED_BY_ANYTHING );
float flHeadScale = m_Shared.InCond( TF_COND_HALLOWEEN_GHOST_MODE ) ? 1.5 : m_flHeadScale;
BuildBigHeadTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, flHeadScale );
BuildTorsoScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale, GetPlayerClass()->GetClassIndex() );
BuildTorsoScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale );
BuildHandScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flHandScale );

BuildFirstPersonMeathookTransformations( hdr, pos, q, cameraTransform, boneMask, boneComputed, "bip_head" );
Expand All @@ -8727,7 +8753,7 @@ void C_TFRagdoll::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion

m_BoneAccessor.SetWritableBones( BONE_USED_BY_ANYTHING );
BuildBigHeadTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flHeadScale );
BuildTorsoScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale, GetClass() );
BuildTorsoScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale );
BuildHandScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flHandScale );

if ( IsDecapitation() && !m_bBaseTransform )
Expand Down