@@ -100,6 +100,9 @@ void CClientPed::Init ( CClientManager* pManager, unsigned long ulModelID, bool
100100 m_pRequester = pManager->GetModelRequestManager ();
101101
102102 m_bisNextAnimationCustom = false ;
103+ m_bisCurrentAnimationCustom = false ;
104+ m_strCustomIFPBlockName = " Default" ;
105+ m_strCustomIFPAnimationName = " Default" ;
103106 m_iVehicleInOutState = VEHICLE_INOUT_NONE;
104107 m_pPlayerPed = NULL ;
105108 m_pTaskManager = NULL ;
@@ -243,11 +246,15 @@ void CClientPed::Init ( CClientManager* pManager, unsigned long ulModelID, bool
243246
244247 SetArmor ( 0 .0f );
245248 }
249+
250+ g_pClientGame->InsertPedPointerToMap ( this );
246251}
247252
248253
249254CClientPed::~CClientPed ( void )
250- {
255+ {
256+ g_pClientGame->RemovePedPointerFromMap ( this );
257+
251258 // Remove from the ped manager
252259 m_pManager->GetPedManager ()->RemoveFromList ( this );
253260
@@ -1032,6 +1039,11 @@ bool CClientPed::SetModel ( unsigned long ulModel, bool bTemp )
10321039 // Different model from what we have now?
10331040 if ( m_ulModel != ulModel )
10341041 {
1042+ if ( m_bisCurrentAnimationCustom )
1043+ {
1044+ m_bisNextAnimationCustom = true ;
1045+ }
1046+
10351047 if ( bTemp )
10361048 m_ulStoredModel = m_ulModel;
10371049
@@ -2862,6 +2874,12 @@ void CClientPed::StreamedInPulse ( bool bDoStandardPulses )
28622874 // Is it loaded now?
28632875 if ( m_pAnimationBlock->IsLoaded () )
28642876 {
2877+ printf (" \n streamed in pulse for ped\n\n " );
2878+ if ( m_bisCurrentAnimationCustom )
2879+ {
2880+ m_bisNextAnimationCustom = true ;
2881+ }
2882+
28652883 m_bRequestedAnimation = false ;
28662884
28672885 // Copy our name incase it gets deleted
@@ -3722,6 +3740,11 @@ void CClientPed::_CreateModel ( void )
37223740 // Are we still playing a looped animation?
37233741 if ( m_bLoopAnimation && m_pAnimationBlock )
37243742 {
3743+ printf (" \n create model for ped\n\n " );
3744+ if ( m_bisCurrentAnimationCustom )
3745+ {
3746+ m_bisNextAnimationCustom = true ;
3747+ }
37253748 // Copy our anim name incase it gets deleted
37263749 SString strAnimName = m_strAnimationName;
37273750 // Run our animation
@@ -4019,6 +4042,12 @@ void CClientPed::_ChangeModel ( void )
40194042 // Are we still playing a looped animation?
40204043 if ( m_bLoopAnimation && m_pAnimationBlock )
40214044 {
4045+ printf (" \n change model for ped\n\n " );
4046+ if ( m_bisCurrentAnimationCustom )
4047+ {
4048+ m_bisNextAnimationCustom = true ;
4049+ }
4050+
40224051 // Copy our anim name incase it gets deleted
40234052 SString strAnimName = m_strAnimationName;
40244053 // Run our animation
@@ -4074,13 +4103,7 @@ void CClientPed::ReCreateModel ( void )
40744103
40754104
40764105void CClientPed::ModelRequestCallback ( CModelInfo* pModelInfo )
4077- {
4078- RpClump * pOldClump = m_pPlayerPed->GetRpClump ();
4079-
4080- printf (" CClientPed::ModelRequestCallback Called! pOldClump: %p\n " , pOldClump);
4081-
4082- g_pGame->GetAnimManager ()->RemovePedPointerFromMap ( pOldClump );
4083-
4106+ {
40844107 // If we have a player loaded
40854108 if ( m_pPlayerPed )
40864109 {
@@ -4092,11 +4115,6 @@ void CClientPed::ModelRequestCallback ( CModelInfo* pModelInfo )
40924115 // If we don't have a player loaded, load it
40934116 _CreateModel ();
40944117 }
4095-
4096- RpClump * pNewClump = m_pPlayerPed->GetRpClump ();
4097- g_pGame->GetAnimManager ()->InsertPedPointerToMap ( pNewClump, this );
4098-
4099- printf (" CClientPed::ModelRequestCallback: Model changed/created | pNewClump: %p\n " , m_pPlayerPed->GetRpClump ());
41004118}
41014119
41024120
@@ -5262,6 +5280,7 @@ void CClientPed::Respawn ( CVector * pvecPosition, bool bRestoreState, bool bCam
52625280 // We must not call CPed::Respawn for remote players
52635281 if ( m_bIsLocalPlayer )
52645282 {
5283+ setNextAnimationNormal ( );
52655284 SetFrozenWaitingForGroundToLoad ( true );
52665285 if ( m_pPlayerPed )
52675286 {
@@ -5869,6 +5888,7 @@ void CClientPed::KillAnimation ( void )
58695888 m_pAnimationBlock = NULL ;
58705889 m_strAnimationName = " " ;
58715890 m_bRequestedAnimation = false ;
5891+ setNextAnimationNormal ( );
58725892}
58735893
58745894void CClientPed::PostWeaponFire ( void )
0 commit comments