Fix for when IKs aren't used.

This commit is contained in:
Kamay Xutax 2024-09-13 02:46:53 +02:00
parent db3027fa29
commit b5e44d0ba6
2 changed files with 2 additions and 1 deletions

View file

@ -480,6 +480,7 @@ void CBaseAnimatingOverlay::GetSkeleton( CStudioHdr *pStudioHdr, Vector pos[], Q
if ( m_pIk )
{
CIKContext auto_ik;
m_iIKCounter++;
auto_ik.Init( pStudioHdr, GetRenderAngles(), GetAbsOrigin(), gpGlobals->curtime, m_iIKCounter, boneMask );
boneSetup.CalcAutoplaySequences( pos, q, gpGlobals->curtime, &auto_ik );
}

View file

@ -2011,7 +2011,7 @@ void CBaseAnimating::SetupBones( matrix3x4_t *pBoneToWorld, int boneMask )
Vector adjOrigin = GetAbsOrigin() + Vector( 0, 0, m_flEstIkOffset );
// NOTE: For model scaling, we need to opt out of IK because it will mark the bones as already being calculated
if ( !IsModelScaled() )
if ( !IsModelScaled() && m_bUseIks )
{
// only allocate an ik block if the npc can use it
if ( !m_pIk && pStudioHdr->numikchains() > 0 )