@@ -151,7 +151,7 @@ WORD CClientIFP::ReadSequencesWithDummies(std::unique_ptr<CAnimBlendHierarchy>&
151151 MoveSequencesWithDummies (pAnimationHierarchy, MapOfSequences);
152152 WORD cSequences = m_kcIFPSequences + wUnknownSequences;
153153
154- // As we need support for all 32 bones, we must change the total sequences count
154+ // As we need support for all 64 bones (32 ped + 32 cutscene ped) , we must change the total sequences count
155155 pAnimationHierarchy->SetNumSequences (cSequences);
156156 return cSequences;
157157}
@@ -243,7 +243,7 @@ std::int32_t CClientIFP::ReadSequenceVersion1(SAnim& Anim)
243243 RoundSize (Anim.Base .Size );
244244 ReadBytes (&Anim.Name , Anim.Base .Size );
245245
246- SString strBoneName = ConvertStringToKey (Anim.Name );
246+ SString strBoneName = ConvertStringToKey (Anim.Name , true );
247247 std::int32_t iBoneID = GetBoneIDFromName (strBoneName);
248248
249249 SString strCorrectBoneName = GetCorrectBoneNameFromName (strBoneName);
@@ -769,10 +769,21 @@ void CClientIFP::CopyDummyKeyFrameByBoneID(BYTE* pKeyFrames, DWORD dwBoneID)
769769 }
770770}
771771
772- SString CClientIFP::ConvertStringToKey (const SString& strBoneName)
772+ SString CClientIFP::ConvertStringToKey (const SString& strBoneName, bool isANPK )
773773{
774- SString ConvertedString = strBoneName.ToLower ();
775- // Remove white spaces
774+ SString ConvertedString = strBoneName;
775+
776+ // Fix for some cutscene bones (like cssuitcase:Pelvis etc.)
777+ if (isANPK)
778+ {
779+ std::size_t pos = ConvertedString.find (" :" );
780+ if (pos != std::string::npos)
781+ ConvertedString = ConvertedString.substr (pos + 1 );
782+ }
783+
784+ ConvertedString = ConvertedString.ToLower ();
785+
786+ // Remove whitespaces
776787 ConvertedString.erase (std::remove (ConvertedString.begin (), ConvertedString.end (), ' ' ), ConvertedString.end ());
777788 return ConvertedString;
778789}
@@ -803,8 +814,7 @@ constexpr bool CClientIFP::IsKeyFramesTypeRoot(eFrameType iFrameType)
803814
804815std::int32_t CClientIFP::GetBoneIDFromName (const SString& strBoneName)
805816{
806- // Some cutscene animations have different names like Root suitcase-1, etc
807- if (strBoneName == " root" || strBoneName.substr (0 , 4 ) == " root" )
817+ if (strBoneName == " root" )
808818 return eBoneType::NORMAL;
809819 if (strBoneName == " normal" )
810820 return eBoneType::NORMAL;
@@ -1133,8 +1143,7 @@ SString CClientIFP::GetCorrectBoneNameFromID(const std::int32_t& iBoneID)
11331143
11341144SString CClientIFP::GetCorrectBoneNameFromName (const SString& strBoneName)
11351145{
1136- // Some cutscene animations have different names like Root suitcase-1, etc
1137- if (strBoneName == " root" || strBoneName.substr (0 , 4 ) == " root" )
1146+ if (strBoneName == " root" )
11381147 return " Normal" ;
11391148 if (strBoneName == " normal" )
11401149 return " Normal" ;
0 commit comments