@@ -6210,11 +6210,20 @@ void CClientPed::ReplaceAnimation ( CAnimBlendHierarchy * pInternalAnimHierarchy
62106210 SReplacedAnimation replacedAnimation;
62116211 replacedAnimation.pIFP = pIFP;
62126212 replacedAnimation.pAnimationHierarchy = pCustomAnimHierarchy;
6213+
6214+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
62136215 m_mapOfReplacedAnimations [ pInternalAnimHierarchy->GetInterface () ] = replacedAnimation;
62146216}
62156217
6218+ void CClientPed::RestoreAnimation ( CAnimBlendHierarchy * pInternalAnimHierarchy )
6219+ {
6220+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6221+ m_mapOfReplacedAnimations.erase ( pInternalAnimHierarchy->GetInterface () );
6222+ }
6223+
62166224void CClientPed::RestoreAnimations ( const std::shared_ptr < CClientIFP > & IFP )
62176225{
6226+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
62186227 for ( auto const & x : m_mapOfReplacedAnimations )
62196228 {
62206229 if ( std::addressof ( *IFP.get ( ) ) == std::addressof ( *x.second .pIFP .get ( ) ) )
@@ -6226,6 +6235,7 @@ void CClientPed::RestoreAnimations ( const std::shared_ptr < CClientIFP > & IFP
62266235
62276236void CClientPed::RestoreAnimations ( CAnimBlock & animationBlock )
62286237{
6238+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
62296239 const size_t cAnimations = animationBlock.GetAnimationCount ( );
62306240 for ( size_t i = 0 ; i < cAnimations; i++ )
62316241 {
@@ -6234,8 +6244,15 @@ void CClientPed::RestoreAnimations ( CAnimBlock & animationBlock )
62346244 }
62356245}
62366246
6247+ void CClientPed::RestoreAllAnimations ( void )
6248+ {
6249+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6250+ m_mapOfReplacedAnimations.clear ( );
6251+ }
6252+
62376253SReplacedAnimation * CClientPed::GetReplacedAnimation ( CAnimBlendHierarchySAInterface * pInternalHierarchyInterface )
62386254{
6255+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
62396256 CClientPed::ReplacedAnim_type::iterator it;
62406257 it = m_mapOfReplacedAnimations.find ( pInternalHierarchyInterface );
62416258 if ( it != m_mapOfReplacedAnimations.end ( ) )
0 commit comments