@@ -16,15 +16,14 @@ h_CAnimBlendHierarchy_CalcTotalTime OLD__CAnimBlendHierarchy_CalcTotalTi
16
16
extern DWORD BoneIds[];
17
17
extern char BoneNames[][24 ];
18
18
19
- DWORD CClientIFP::s_iAnimationSearchReferences = 0 ;
20
-
21
19
CClientIFP::CClientIFP ( class CClientManager * pManager, ElementID ID ) : CClientEntity ( ID )
22
20
{
23
21
// Init
24
22
m_pManager = pManager;
25
23
SetTypeName ( " IFP" );
26
24
m_bisIFPLoaded = false ;
27
25
m_pIFPAnimations = nullptr ;
26
+ iAnimationSearchReferences = 0 ;
28
27
}
29
28
30
29
CClientIFP::~CClientIFP ( void )
@@ -70,11 +69,9 @@ void CClientIFP::UnloadIFP ( void )
70
69
m_pIFPAnimations->bUnloadOnZeroReferences = true ;
71
70
72
71
// unload IFP animations, if reference count is zero
73
- if ( ( m_pIFPAnimations->iReferences == 0 ) && ( s_iAnimationSearchReferences == 0 ) )
72
+ if ( ( m_pIFPAnimations->iReferences == 0 ) && ( iAnimationSearchReferences == 0 ) )
74
73
{
75
- g_pClientGame->UnloadIFPAnimations ( m_pIFPAnimations );
76
-
77
- delete m_pIFPAnimations;
74
+ g_pClientGame->DeleteIFPAnimations ( m_pIFPAnimations );
78
75
}
79
76
}
80
77
}
@@ -1166,7 +1163,7 @@ CAnimBlendHierarchySAInterface * CClientIFP::GetAnimationHierarchy ( const SStri
1166
1163
CAnimBlendHierarchySAInterface * pAnimHierarchyInterface = nullptr ;
1167
1164
if ( m_bisIFPLoaded )
1168
1165
{
1169
- s_iAnimationSearchReferences ++;
1166
+ iAnimationSearchReferences ++;
1170
1167
for (auto it = m_pVecAnimations->begin (); it != m_pVecAnimations->end (); ++it)
1171
1168
{
1172
1169
if (strAnimationName.ToLower () == it->Name .ToLower ())
@@ -1175,7 +1172,7 @@ CAnimBlendHierarchySAInterface * CClientIFP::GetAnimationHierarchy ( const SStri
1175
1172
break ;
1176
1173
}
1177
1174
}
1178
- s_iAnimationSearchReferences --;
1175
+ iAnimationSearchReferences --;
1179
1176
}
1180
1177
return pAnimHierarchyInterface;
1181
1178
}
0 commit comments