Skip to content

Commit 0ba8e13

Browse files
committed
added new functions for adding IFP pointer to map and checks for playing custom animation, not complete though. Custom animation is checked nicely, but isGateWayAnimationHierarchy function is not working properly.
1 parent acf46a7 commit 0ba8e13

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3989,15 +3989,20 @@ CAnimBlendAssociationSAInterface * CClientGame::AddAnimationHandler ( RpClump *
39893989

39903990
CAnimManager * pAnimationManager = g_pGame->GetAnimManager();
39913991

3992-
CClientPed * pClientPed = pAnimationManager->GetClientPedFromClumpMap ( pClump );
3992+
CClientPed * pClientPed = pAnimationManager->GetPedPointerFromMap ( pClump );
39933993
if ( pClientPed != nullptr )
39943994
{
3995-
// printf ("pClientPed found! | GroupID: %d | AnimID: %d \n\n", pAnimStaticAssoc->sAnimGroup, pAnimStaticAssoc->sAnimID);
3995+
if ( pClientPed->isNextAnimationCustom () )
3996+
{
3997+
printf("pClientPed->isNextAnimationCustom () is true\n");
39963998

3997-
auto pAnimStaticAssoc = pAnimationManager->GetAnimStaticAssociation ( animGroup, animID );
3998-
if ( pAnimationManager->isGateWayAnimationHierarchy ( pAnimStaticAssoc->pAnimHeirarchy ) )
3999-
{
3999+
auto pAnimStaticAssoc = pAnimationManager->GetAnimStaticAssociation ( animGroup, animID );
4000+
if ( pAnimationManager->isGateWayAnimationHierarchy ( pAnimStaticAssoc->pAnimHeirarchy ) )
4001+
{
4002+
printf("pAnimationManager->isGateWayAnimationHierarchy() is true\n");
40004003

4004+
pClientPed->setNextAnimationNormal ( );
4005+
}
40014006
}
40024007
}
40034008

@@ -6741,3 +6746,26 @@ void CClientGame::RestreamModel ( unsigned short usModel )
67416746
m_pManager->GetVehicleManager ()->RestreamVehicleUpgrades ( usModel );
67426747

67436748
}
6749+
6750+
void CClientGame::InsertIFPPointerToMap ( SString strBlockName, CClientIFP * pIFP )
6751+
{
6752+
if ( m_mapOfIfpPointers.count ( strBlockName ) == 0 )
6753+
{
6754+
m_mapOfIfpPointers [ strBlockName ] = pIFP;
6755+
}
6756+
}
6757+
6758+
void CClientGame::RemoveIFPPointerFromMap ( SString strBlockName )
6759+
{
6760+
m_mapOfIfpPointers.erase ( strBlockName );
6761+
}
6762+
6763+
CClientIFP * CClientGame::GetIFPPointerFromMap ( SString strBlockName )
6764+
{
6765+
std::map < SString, CClientIFP * >::iterator it = m_mapOfIfpPointers.find ( strBlockName );
6766+
if ( it != m_mapOfIfpPointers.end ( ) )
6767+
{
6768+
return it->second;
6769+
}
6770+
return nullptr;
6771+
}

0 commit comments

Comments
 (0)