@@ -3701,9 +3701,9 @@ bool CClientGame::StaticChokingHandler ( unsigned char ucWeaponType )
37013701 return g_pClientGame->ChokingHandler ( ucWeaponType );
37023702}
37033703
3704- void CClientGame::StaticCAnimBlendAssocHierConstructorHandler ( CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface * pAnimHierarchy )
3704+ bool CClientGame::StaticCAnimBlendAssocHierConstructorHandler ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface * pAnimHierarchy )
37053705{
3706- g_pClientGame->CAnimBlendAssocHierConstructorHandler ( pThis, pClump, pAnimHierarchy );
3706+ return g_pClientGame->CAnimBlendAssocHierConstructorHandler ( pOutIFPAnimations, pThis, pClump, pAnimHierarchy );
37073707}
37083708
37093709void CClientGame::StaticCAnimBlendAssocDestructorHandler ( CAnimBlendAssociationSAInterface * pThis )
@@ -4013,9 +4013,24 @@ bool CClientGame::ChokingHandler ( unsigned char ucWeaponType )
40134013}
40144014
40154015
4016- void CClientGame::CAnimBlendAssocHierConstructorHandler ( CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface * pAnimHierarchy )
4016+ bool CClientGame::CAnimBlendAssocHierConstructorHandler ( SIFPAnimations ** pOutIFPAnimations, CAnimBlendAssociationSAInterface * pThis, RpClump * pClump, CAnimBlendHierarchySAInterface * pAnimHierarchy )
40174017{
40184018 printf (" CClientGame::CAnimBlendAssocHierConstructorHandler called! sAnimID: %d\n " , pThis->sAnimID );
4019+ bool isCustomAnimationToPlay = false ;
4020+
4021+ CAnimManager * pAnimationManager = g_pGame->GetAnimManager ();
4022+ CClientPed * pClientPed = GetClientPedByClump ( *pClump );
4023+ if ( pClientPed != nullptr )
4024+ {
4025+ printf (" CAnimBlendAssocHierConstructorHandler: got pClientPed\n\n " );
4026+ if ( pClientPed->IsCurrentAnimationCustom ( ) )
4027+ {
4028+ printf (" CAnimBlendAssocHierConstructorHandler: current animation is custom\n\n " );
4029+ *pOutIFPAnimations = pClientPed->GetIFPAnimationsPointer ();
4030+ isCustomAnimationToPlay = true ;
4031+ }
4032+ }
4033+ return isCustomAnimationToPlay;
40194034}
40204035
40214036
@@ -4109,15 +4124,14 @@ CAnimBlendHierarchySAInterface * CClientGame::BlendAnimationHierarchyHandler ( R
41094124 auto pCustomAnimBlendHierarchy = pIFP->GetAnimationHierarchy ( strAnimationName );
41104125 if ( pCustomAnimBlendHierarchy != nullptr )
41114126 {
4112- printf (" BlendAnimationHierarchyHandler: Found Hierarchy, returning \n " );
4113-
41144127 pClientPed->setCurrentAnimationCustom ( true );
4115-
4128+ pClientPed-> SetIFPAnimationsPointer ( pIFP-> GetIFPAnimationsPointer () );
41164129 // Modifying a hierarchy like this is just bad, it's much better to create a new CAnimBlendHierarchySAInterface for every animation
41174130 // and then delete it once animation is over
41184131 pCustomAnimBlendHierarchy->iHashKey = pAnimHierarchy->iHashKey ;
41194132 pCustomAnimBlendHierarchy->iAnimBlockID = pAnimHierarchy->iAnimBlockID ;
41204133 pClientPed->setNextAnimationNormal ( );
4134+ printf (" BlendAnimationHierarchyHandler: Found Hierarchy, returning \n " );
41214135 return pCustomAnimBlendHierarchy;
41224136 }
41234137 else
@@ -4130,10 +4144,8 @@ CAnimBlendHierarchySAInterface * CClientGame::BlendAnimationHierarchyHandler ( R
41304144 printf (" BlendAnimationHierarchyHandler: could not find IFP block name '%s'\n " , strBlockName.c_str ());
41314145 }
41324146 }
4133- else
4134- {
4135- pClientPed->setCurrentAnimationCustom ( false );
4136- }
4147+
4148+ pClientPed->setCurrentAnimationCustom ( false );
41374149 pClientPed->setNextAnimationNormal ( );
41384150 }
41394151 return pAnimHierarchy;
0 commit comments