@@ -6210,11 +6210,20 @@ void CClientPed::ReplaceAnimation ( CAnimBlendHierarchy * pInternalAnimHierarchy
6210
6210
SReplacedAnimation replacedAnimation;
6211
6211
replacedAnimation.pIFP = pIFP;
6212
6212
replacedAnimation.pAnimationHierarchy = pCustomAnimHierarchy;
6213
+
6214
+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6213
6215
m_mapOfReplacedAnimations [ pInternalAnimHierarchy->GetInterface () ] = replacedAnimation;
6214
6216
}
6215
6217
6218
+ void CClientPed::RestoreAnimation ( CAnimBlendHierarchy * pInternalAnimHierarchy )
6219
+ {
6220
+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6221
+ m_mapOfReplacedAnimations.erase ( pInternalAnimHierarchy->GetInterface () );
6222
+ }
6223
+
6216
6224
void CClientPed::RestoreAnimations ( const std::shared_ptr < CClientIFP > & IFP )
6217
6225
{
6226
+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6218
6227
for ( auto const & x : m_mapOfReplacedAnimations )
6219
6228
{
6220
6229
if ( std::addressof ( *IFP.get ( ) ) == std::addressof ( *x.second .pIFP .get ( ) ) )
@@ -6226,6 +6235,7 @@ void CClientPed::RestoreAnimations ( const std::shared_ptr < CClientIFP > & IFP
6226
6235
6227
6236
void CClientPed::RestoreAnimations ( CAnimBlock & animationBlock )
6228
6237
{
6238
+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6229
6239
const size_t cAnimations = animationBlock.GetAnimationCount ( );
6230
6240
for ( size_t i = 0 ; i < cAnimations; i++ )
6231
6241
{
@@ -6234,8 +6244,15 @@ void CClientPed::RestoreAnimations ( CAnimBlock & animationBlock )
6234
6244
}
6235
6245
}
6236
6246
6247
+ void CClientPed::RestoreAllAnimations ( void )
6248
+ {
6249
+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6250
+ m_mapOfReplacedAnimations.clear ( );
6251
+ }
6252
+
6237
6253
SReplacedAnimation * CClientPed::GetReplacedAnimation ( CAnimBlendHierarchySAInterface * pInternalHierarchyInterface )
6238
6254
{
6255
+ std::lock_guard < std::mutex > mutexGuardedLock ( m_MutexOfReplacedAnimationsMap );
6239
6256
CClientPed::ReplacedAnim_type::iterator it;
6240
6257
it = m_mapOfReplacedAnimations.find ( pInternalHierarchyInterface );
6241
6258
if ( it != m_mapOfReplacedAnimations.end ( ) )
0 commit comments