@@ -23,7 +23,6 @@ CClientIFP::CClientIFP ( class CClientManager* pManager, ElementID ID ) : CClien
2323 SetTypeName ( " IFP" );
2424 m_bisIFPLoaded = false ;
2525 m_pIFPAnimations = nullptr ;
26- iAnimationSearchReferences = 0 ;
2726}
2827
2928CClientIFP::~CClientIFP ( void )
@@ -69,7 +68,7 @@ void CClientIFP::UnloadIFP ( void )
6968 m_pIFPAnimations->bUnloadOnZeroReferences = true ;
7069
7170 // unload IFP animations, if reference count is zero
72- if ( ( m_pIFPAnimations->iReferences == 0 ) && ( iAnimationSearchReferences == 0 ) )
71+ if ( m_pIFPAnimations->iReferences == 0 )
7372 {
7473 g_pClientGame->DeleteIFPAnimations ( m_pIFPAnimations );
7574 }
@@ -1161,18 +1160,17 @@ std::string CClientIFP::getCorrectBoneNameFromName(std::string const& BoneName)
11611160CAnimBlendHierarchySAInterface * CClientIFP::GetAnimationHierarchy ( const SString & strAnimationName )
11621161{
11631162 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 ())
11681167 {
1169- if (strAnimationName. ToLower () == it-> Name . ToLower () )
1170- {
1168+ if ( m_bisIFPLoaded )
1169+ {
11711170 pAnimHierarchyInterface = (CAnimBlendHierarchySAInterface *)&it->Hierarchy ;
1172- break ;
11731171 }
1172+ break ;
11741173 }
1175- iAnimationSearchReferences --;
11761174 }
11771175 return pAnimHierarchyInterface;
11781176}
0 commit comments