Use the weight's bone index if there is no morph

This commit is contained in:
smallmodel 2024-06-04 19:52:32 +02:00
parent e1f2433c36
commit 0181fbcfa0
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -1250,7 +1250,12 @@ void RB_SkelMesh( skelSurfaceGame_t *sf ) {
morph++; morph++;
} }
if (newVerts->numMorphs) {
channelNum = skelmodel->pBones[morph->morphIndex].channel; channelNum = skelmodel->pBones[morph->morphIndex].channel;
} else {
channelNum = skelmodel->pBones[weight->boneIndex].channel;
}
boneNum = tiki->m_boneList.GetLocalFromGlobal( channelNum ); boneNum = tiki->m_boneList.GetLocalFromGlobal( channelNum );
bone = &bones[ boneNum ]; bone = &bones[ boneNum ];
@ -1282,7 +1287,12 @@ void RB_SkelMesh( skelSurfaceGame_t *sf ) {
morph++; morph++;
} }
if (newVerts->numMorphs) {
bone = &bones[morph->morphIndex]; bone = &bones[morph->morphIndex];
} else {
bone = &bones[weight->boneIndex];
}
SkelVertGetNormal( newVerts, bone, normal ); SkelVertGetNormal( newVerts, bone, normal );
for( weightNum = 0; weightNum < newVerts->numWeights; weightNum++ ) { for( weightNum = 0; weightNum < newVerts->numWeights; weightNum++ ) {