@@ -263,7 +263,6 @@ CClientGame::CClientGame(bool bLocalPlay)
263263 g_pMultiplayer->SetAddAnimationAndSyncHandler (CClientGame::StaticAddAnimationAndSyncHandler);
264264 g_pMultiplayer->SetAssocGroupCopyAnimationHandler (CClientGame::StaticAssocGroupCopyAnimationHandler);
265265 g_pMultiplayer->SetBlendAnimationHierarchyHandler (CClientGame::StaticBlendAnimationHierarchyHandler);
266- g_pMultiplayer->SetBlendAnimationHandler (CClientGame::StaticBlendAnimationHandler);
267266 g_pMultiplayer->SetProcessCollisionHandler (CClientGame::StaticProcessCollisionHandler);
268267 g_pMultiplayer->SetVehicleCollisionHandler (CClientGame::StaticVehicleCollisionHandler);
269268 g_pMultiplayer->SetVehicleDamageHandler (CClientGame::StaticVehicleDamageHandler);
@@ -432,7 +431,6 @@ CClientGame::~CClientGame()
432431 g_pMultiplayer->SetAddAnimationAndSyncHandler (NULL );
433432 g_pMultiplayer->SetAssocGroupCopyAnimationHandler (NULL );
434433 g_pMultiplayer->SetBlendAnimationHierarchyHandler (NULL );
435- g_pMultiplayer->SetBlendAnimationHandler (nullptr );
436434 g_pMultiplayer->SetProcessCollisionHandler (NULL );
437435 g_pMultiplayer->SetVehicleCollisionHandler (NULL );
438436 g_pMultiplayer->SetVehicleDamageHandler (NULL );
@@ -3697,11 +3695,6 @@ bool CClientGame::StaticBlendAnimationHierarchyHandler(CAnimBlendAssociationSAIn
36973695 return g_pClientGame->BlendAnimationHierarchyHandler (pAnimAssoc, pOutAnimHierarchy, pFlags, pClump);
36983696}
36993697
3700- bool CClientGame::StaticBlendAnimationHandler (RpClump* pClump, AssocGroupId animGroup, AnimationId animID, float fBlendData )
3701- {
3702- return g_pClientGame->BlendAnimationHandler (pClump, animGroup, animID, fBlendData );
3703- }
3704-
37053698void CClientGame::StaticPreWorldProcessHandler ()
37063699{
37073700 g_pClientGame->PreWorldProcessHandler ();
@@ -4048,20 +4041,40 @@ bool CClientGame::AssocGroupCopyAnimationHandler(CAnimBlendAssociationSAInterfac
40484041 CClientPed* pClientPed = GetClientPedByClump (*pClump);
40494042 if (pClientPed != nullptr )
40504043 {
4051- auto pReplacedAnimation = pClientPed->GetReplacedAnimation (pOriginalAnimHierarchyInterface);
4052- if (pReplacedAnimation != nullptr )
4044+ std::unique_ptr<CAnimBlendHierarchy> pAnimHierarchy = nullptr ;
4045+ if (pClientPed->IsTaskToBeRestoredOnAnimEnd () && pClientPed->GetTaskTypeToBeRestoredOnAnimEnd () == TASK_SIMPLE_DUCK)
4046+ {
4047+ // check for idle animation
4048+ if (animID == 3 )
4049+ {
4050+ if ((iGroupID == 0 ) || (iGroupID >= 54 && iGroupID <= 70 ) || (iGroupID >= 118 ))
4051+ {
4052+ auto pDuckAnimStaticAssoc = pAnimationManager->GetAnimStaticAssociation (0 , 55 );
4053+ pAnimHierarchy = pAnimationManager->GetCustomAnimBlendHierarchy (pDuckAnimStaticAssoc->GetAnimHierachyInterface ());
4054+ isCustomAnimationToPlay = true ;
4055+ }
4056+ }
4057+ }
4058+ else
40534059 {
4054- std::shared_ptr<CIFPAnimations> pIFPAnimations = pReplacedAnimation->pIFP ->GetIFPAnimationsPointer ();
4055- InsertAnimationAssociationToMap (pAnimAssocInterface, pIFPAnimations);
4060+ auto pReplacedAnimation = pClientPed->GetReplacedAnimation (pOriginalAnimHierarchyInterface);
4061+ if (pReplacedAnimation != nullptr )
4062+ {
4063+ std::shared_ptr<CIFPAnimations> pIFPAnimations = pReplacedAnimation->pIFP ->GetIFPAnimationsPointer ();
4064+ InsertAnimationAssociationToMap (pAnimAssocInterface, pIFPAnimations);
40564065
4057- // Play our custom animation instead of default
4058- auto pAnimHierarchy = pAnimationManager->GetCustomAnimBlendHierarchy (pReplacedAnimation->pAnimationHierarchy );
4066+ // Play our custom animation instead of default
4067+ pAnimHierarchy = pAnimationManager->GetCustomAnimBlendHierarchy (pReplacedAnimation->pAnimationHierarchy );
4068+ isCustomAnimationToPlay = true ;
4069+ }
4070+ }
4071+ if (isCustomAnimationToPlay)
4072+ {
40594073 pAnimationManager->UncompressAnimation (pAnimHierarchy.get ());
40604074 pAnimAssociation->InitializeForCustomAnimation (pClump, pAnimHierarchy->GetInterface ());
40614075 pAnimAssociation->SetFlags (pOriginalAnimStaticAssoc->GetFlags ());
40624076 pAnimAssociation->SetAnimID (pOriginalAnimStaticAssoc->GetAnimID ());
40634077 pAnimAssociation->SetAnimGroup (pOriginalAnimStaticAssoc->GetAnimGroup ());
4064- isCustomAnimationToPlay = true ;
40654078 }
40664079 }
40674080
@@ -4116,26 +4129,6 @@ bool CClientGame::BlendAnimationHierarchyHandler(CAnimBlendAssociationSAInterfac
41164129 return isCustomAnimationToPlay;
41174130}
41184131
4119- bool CClientGame::BlendAnimationHandler (RpClump* pClump, AssocGroupId animGroup, AnimationId animID, float fBlendData )
4120- {
4121- CClientPed* pClientPed = GetClientPedByClump (*pClump);
4122- if (pClientPed != nullptr )
4123- {
4124- if (pClientPed->IsTaskToBeRestoredOnAnimEnd () && pClientPed->GetTaskTypeToBeRestoredOnAnimEnd () == TASK_SIMPLE_DUCK)
4125- {
4126- // check for idle animation
4127- if (animID == 3 )
4128- {
4129- if ((animGroup == 0 ) || (animGroup >= 54 && animGroup <= 70 ) || (animGroup >= 118 ))
4130- {
4131- return false ;
4132- }
4133- }
4134- }
4135- }
4136- return true ;
4137- }
4138-
41394132bool CClientGame::ProcessCollisionHandler (CEntitySAInterface* pThisInterface, CEntitySAInterface* pOtherInterface)
41404133{
41414134 if (pThisInterface == pOtherInterface)
0 commit comments