@@ -23,7 +23,6 @@ CClientIFP::CClientIFP ( class CClientManager* pManager, ElementID ID ) : CClien
23
23
SetTypeName ( " IFP" );
24
24
m_bisIFPLoaded = false ;
25
25
m_pIFPAnimations = nullptr ;
26
- iAnimationSearchReferences = 0 ;
27
26
}
28
27
29
28
CClientIFP::~CClientIFP ( void )
@@ -69,7 +68,7 @@ void CClientIFP::UnloadIFP ( void )
69
68
m_pIFPAnimations->bUnloadOnZeroReferences = true ;
70
69
71
70
// unload IFP animations, if reference count is zero
72
- if ( ( m_pIFPAnimations->iReferences == 0 ) && ( iAnimationSearchReferences == 0 ) )
71
+ if ( m_pIFPAnimations->iReferences == 0 )
73
72
{
74
73
g_pClientGame->DeleteIFPAnimations ( m_pIFPAnimations );
75
74
}
@@ -1161,18 +1160,17 @@ std::string CClientIFP::getCorrectBoneNameFromName(std::string const& BoneName)
1161
1160
CAnimBlendHierarchySAInterface * CClientIFP::GetAnimationHierarchy ( const SString & strAnimationName )
1162
1161
{
1163
1162
CAnimBlendHierarchySAInterface * pAnimHierarchyInterface = nullptr ;
1164
- if ( m_bisIFPLoaded )
1165
- {
1166
- iAnimationSearchReferences ++;
1167
- for ( auto it = m_pVecAnimations-> begin (); it != m_pVecAnimations-> end (); ++it)
1163
+
1164
+ for ( auto it = m_pVecAnimations-> begin (); it != m_pVecAnimations-> end (); ++it)
1165
+ {
1166
+ if (strAnimationName. ToLower () == it-> Name . ToLower ())
1168
1167
{
1169
- if (strAnimationName. ToLower () == it-> Name . ToLower () )
1170
- {
1168
+ if ( m_bisIFPLoaded )
1169
+ {
1171
1170
pAnimHierarchyInterface = (CAnimBlendHierarchySAInterface *)&it->Hierarchy ;
1172
- break ;
1173
1171
}
1172
+ break ;
1174
1173
}
1175
- iAnimationSearchReferences --;
1176
1174
}
1177
1175
return pAnimHierarchyInterface;
1178
1176
}
0 commit comments