fixed bug in cutscene head

This commit is contained in:
aap 2020-05-12 09:44:50 +02:00
parent d5676be83e
commit fab453efde

View File

@ -105,8 +105,11 @@ CCutsceneHead::Render(void)
m_matrix.SetRotateY(PI/2); m_matrix.SetRotateY(PI/2);
m_matrix = CMatrix(mat) * m_matrix; m_matrix = CMatrix(mat) * m_matrix;
} }
// This is head...it has no limbs
#ifndef FIX_BUGS
RenderLimb(BONE_Lhand); RenderLimb(BONE_Lhand);
RenderLimb(BONE_Rhand); RenderLimb(BONE_Rhand);
#endif
}else }else
#endif #endif
{ {
@ -127,11 +130,15 @@ CCutsceneHead::Render(void)
void void
CCutsceneHead::RenderLimb(int32 bone) CCutsceneHead::RenderLimb(int32 bone)
{ {
// It's not clear what this is...
// modelinfo for this object is not a ped so it also doesn't have any limbs
#ifndef FIX_BUGS
RpAtomic *atomic; RpAtomic *atomic;
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(m_parentObject->GetClump()); RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(m_parentObject->GetClump());
int idx = RpHAnimIDGetIndex(hier, bone); int idx = RpHAnimIDGetIndex(hier, bone);
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier); RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
CPedModelInfo *mi = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()); CPedModelInfo *mi = (CPedModelInfo*)CModelInfo::GetModelInfo(GetModelIndex());
assert(mi->GetModelType() == MITYPE_PED);
switch(bone){ switch(bone){
case BONE_Lhand: case BONE_Lhand:
atomic = mi->getLeftHand(); atomic = mi->getLeftHand();
@ -148,6 +155,7 @@ CCutsceneHead::RenderLimb(int32 bone)
RwFrameUpdateObjects(frame); RwFrameUpdateObjects(frame);
RpAtomicRender(atomic); RpAtomicRender(atomic);
} }
#endif
} }
#endif #endif