Skip to content

Commit 244e2ec

Browse files
committed
1 parent ac1ca0b commit 244e2ec

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

src/game/client/tf/c_tf_player.cpp

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8724,10 +8724,18 @@ void BuildBigHeadTransformations( CBaseAnimating *pObject, CStudioHdr *hdr, Vect
87248724
// Scale the head.
87258725
MatrixScaleBy ( flScale, transform );
87268726

8727+
#ifdef BDSBASE
8728+
const int cMaxNumHelms = 4;
8729+
#else
87278730
const int cMaxNumHelms = 2;
8731+
#endif
87288732
int iHelmIndex[cMaxNumHelms];
87298733
iHelmIndex[0] = pObject->LookupBone( "prp_helmet" );
87308734
iHelmIndex[1] = pObject->LookupBone( "prp_hat" );
8735+
#ifdef BDSBASE
8736+
iHelmIndex[2] = pObject->LookupBone("prp_cig");
8737+
iHelmIndex[3] = pObject->LookupBone("prp_glasses");
8738+
#endif
87318739

87328740
for ( int i = 0; i < cMaxNumHelms; i++ )
87338741
{
@@ -8774,6 +8782,22 @@ void BuildDecapitatedTransformations( CBaseAnimating *pObject, CStudioHdr *hdr,
87748782
matrix3x4_t &transformhelmet = pObject->GetBoneForWrite( iHelm );
87758783
MatrixScaleByZero ( transformhelmet );
87768784
}
8785+
8786+
#ifdef BDSBASE
8787+
iHelm = pObject->LookupBone("prp_cig");
8788+
if (iHelm != -1)
8789+
{
8790+
matrix3x4_t& transformhelmet = pObject->GetBoneForWrite(iHelm);
8791+
MatrixScaleByZero(transformhelmet);
8792+
}
8793+
8794+
iHelm = pObject->LookupBone("prp_glasses");
8795+
if (iHelm != -1)
8796+
{
8797+
matrix3x4_t& transformhelmet = pObject->GetBoneForWrite(iHelm);
8798+
MatrixScaleByZero(transformhelmet);
8799+
}
8800+
#endif
87778801
}
87788802

87798803

@@ -8828,6 +8852,18 @@ void BuildNeckScaleTransformations(CBaseAnimating* pObject, CStudioHdr* hdr, Vec
88288852
}
88298853
}
88308854

8855+
#ifdef BDSBASE
8856+
if (iClass == TF_CLASS_MEDIC)
8857+
{
8858+
int iGlasses = pObject->LookupBone("prp_glasses");
8859+
if (iGlasses != -1)
8860+
{
8861+
matrix3x4_t& glasses_transform = pObject->GetBoneForWrite(iGlasses);
8862+
MatrixScaleByZero(glasses_transform);
8863+
}
8864+
}
8865+
#endif
8866+
88318867
// Compress the head into the neck.
88328868
int iHead = pObject->LookupBone( "bip_head" );
88338869
if ( iHead != -1 )
@@ -8885,7 +8921,11 @@ void AppendChildren_R( CUtlVector< const mstudiobone_t * > *pChildBones, const s
88858921
//-----------------------------------------------------------------------------
88868922
// Purpose:
88878923
//-----------------------------------------------------------------------------
8888-
void BuildTorsoScaleTransformations( CBaseAnimating *pObject, CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed, float flScale, int iClass )
8924+
#ifdef BDSBASE
8925+
void BuildTorsoScaleTransformations(CBaseAnimating* pObject, CStudioHdr* hdr, Vector* pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList& boneComputed, float flScale)
8926+
#else
8927+
void BuildTorsoScaleTransformations(CBaseAnimating* pObject, CStudioHdr* hdr, Vector* pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList& boneComputed, float flScale, int iClass)
8928+
#endif
88898929
{
88908930
if ( !pObject || flScale == 1.f )
88918931
return;
@@ -9108,7 +9148,11 @@ void C_TFPlayer::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion
91089148
m_BoneAccessor.SetWritableBones( BONE_USED_BY_ANYTHING );
91099149
float flHeadScale = m_Shared.InCond( TF_COND_HALLOWEEN_GHOST_MODE ) ? 1.5 : m_flHeadScale;
91109150
BuildBigHeadTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, flHeadScale );
9111-
BuildTorsoScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale, GetPlayerClass()->GetClassIndex() );
9151+
#ifdef BDSBASE
9152+
BuildTorsoScaleTransformations(this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale);
9153+
#else
9154+
BuildTorsoScaleTransformations(this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale, GetPlayerClass()->GetClassIndex());
9155+
#endif
91129156
BuildHandScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flHandScale );
91139157
#ifdef BDSBASE
91149158
BuildNeckScaleTransformations(this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flNeckScale);
@@ -9127,7 +9171,11 @@ void C_TFRagdoll::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion
91279171

91289172
m_BoneAccessor.SetWritableBones( BONE_USED_BY_ANYTHING );
91299173
BuildBigHeadTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flHeadScale );
9130-
BuildTorsoScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale, GetClass() );
9174+
#ifdef BDSBASE
9175+
BuildTorsoScaleTransformations(this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale);
9176+
#else
9177+
BuildTorsoScaleTransformations(this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flTorsoScale, GetClass());
9178+
#endif
91319179
BuildHandScaleTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flHandScale );
91329180
#ifdef BDSBASE
91339181
BuildNeckScaleTransformations(this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flNeckScale);

0 commit comments

Comments
 (0)