Skip to content

Commit 3c44bcc

Browse files
committed
added a check in GetAnimationHierarchy whether IFP is loaded or not
1 parent b8a92b0 commit 3c44bcc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Client/mods/deathmatch/logic/CClientIFP.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ void CClientIFP::UnloadIFP ( void )
4949
if ( m_bisIFPLoaded )
5050
{
5151
printf ("CClientIFP::UnloadIFP ( ) called!\n");
52+
53+
m_bisIFPLoaded = false;
5254

5355
// first remove IFP from map, so we can indicate that it does not exist
5456
g_pClientGame->RemoveIFPPointerFromMap ( m_strBlockName );
@@ -1173,11 +1175,14 @@ std::string CClientIFP::getCorrectBoneNameFromName(std::string const& BoneName)
11731175

11741176
CAnimBlendHierarchySAInterface * CClientIFP::GetAnimationHierarchy ( const SString & strAnimationName )
11751177
{
1176-
for (auto it = m_Animations.begin(); it != m_Animations.end(); ++it)
1177-
{
1178-
if (strAnimationName.ToLower() == it->Name.ToLower())
1178+
if ( m_bisIFPLoaded )
1179+
{
1180+
for (auto it = m_Animations.begin(); it != m_Animations.end(); ++it)
11791181
{
1180-
return (CAnimBlendHierarchySAInterface *)&it->Hierarchy;
1182+
if (strAnimationName.ToLower() == it->Name.ToLower())
1183+
{
1184+
return (CAnimBlendHierarchySAInterface *)&it->Hierarchy;
1185+
}
11811186
}
11821187
}
11831188
return nullptr;

0 commit comments

Comments
 (0)