Skip to content

Commit c60a3b2

Browse files
committed
UnloadIFP calls DeleteIFPAnimations now and renamed iAnimSearchRef
1 parent 8a67226 commit c60a3b2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Client/mods/deathmatch/logic/CClientIFP.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ h_CAnimBlendHierarchy_CalcTotalTime OLD__CAnimBlendHierarchy_CalcTotalTi
1616
extern DWORD BoneIds[];
1717
extern char BoneNames[][24];
1818

19-
DWORD CClientIFP::s_iAnimationSearchReferences = 0;
20-
2119
CClientIFP::CClientIFP ( class CClientManager* pManager, ElementID ID ) : CClientEntity ( ID )
2220
{
2321
// Init
2422
m_pManager = pManager;
2523
SetTypeName ( "IFP" );
2624
m_bisIFPLoaded = false;
2725
m_pIFPAnimations = nullptr;
26+
iAnimationSearchReferences = 0;
2827
}
2928

3029
CClientIFP::~CClientIFP ( void )
@@ -70,11 +69,9 @@ void CClientIFP::UnloadIFP ( void )
7069
m_pIFPAnimations->bUnloadOnZeroReferences = true;
7170

7271
// 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 ) )
7473
{
75-
g_pClientGame->UnloadIFPAnimations ( m_pIFPAnimations );
76-
77-
delete m_pIFPAnimations;
74+
g_pClientGame->DeleteIFPAnimations ( m_pIFPAnimations );
7875
}
7976
}
8077
}
@@ -1166,7 +1163,7 @@ CAnimBlendHierarchySAInterface * CClientIFP::GetAnimationHierarchy ( const SStri
11661163
CAnimBlendHierarchySAInterface * pAnimHierarchyInterface = nullptr;
11671164
if ( m_bisIFPLoaded )
11681165
{
1169-
s_iAnimationSearchReferences ++;
1166+
iAnimationSearchReferences ++;
11701167
for (auto it = m_pVecAnimations->begin(); it != m_pVecAnimations->end(); ++it)
11711168
{
11721169
if (strAnimationName.ToLower() == it->Name.ToLower())
@@ -1175,7 +1172,7 @@ CAnimBlendHierarchySAInterface * CClientIFP::GetAnimationHierarchy ( const SStri
11751172
break;
11761173
}
11771174
}
1178-
s_iAnimationSearchReferences --;
1175+
iAnimationSearchReferences --;
11791176
}
11801177
return pAnimHierarchyInterface;
11811178
}

0 commit comments

Comments
 (0)