From bb8d0c8906d8ff45b00ed72ad8b78fd00ac82b00 Mon Sep 17 00:00:00 2001 From: Batuhan Tonga <76632145+QueryOfficial@users.noreply.github.com> Date: Fri, 24 Jul 2026 20:41:45 +0300 Subject: [PATCH] Add animation cache initialization in SetPedAnimation method This update initializes the animation cache parameters (startTime, speed, and progress) for the Ped entity within the SetPedAnimation method, ensuring proper handling of animation states during gameplay. --- .../mods/deathmatch/logic/CStaticFunctionDefinitions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index dcd11a4e984..d9018d907f8 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -2264,6 +2264,9 @@ bool CStaticFunctionDefinitions::SetPedAnimation(CClientEntity& Entity, const SS Ped.SetCurrentAnimationCustom(false); Ped.SetNextAnimationNormal(); Ped.RunNamedAnimation(pBlock, szAnimName, iTime, iBlend, bLoop, bUpdatePosition, bInterruptible, bFreezeLastFrame); + Ped.m_AnimationCache.startTime = GetTimestamp(); + Ped.m_AnimationCache.speed = 1.0f; + Ped.m_AnimationCache.progress = 0.0f; return true; } else @@ -2283,12 +2286,13 @@ bool CStaticFunctionDefinitions::SetPedAnimation(CClientEntity& Entity, const SS const char* szGateWayAnimationName = g_pGame->GetAnimManager()->GetGateWayAnimationName(); Ped.RunNamedAnimation(pBlock, szGateWayAnimationName, iTime, iBlend, bLoop, bUpdatePosition, bInterruptible, bFreezeLastFrame); + Ped.m_AnimationCache.startTime = GetTimestamp(); + Ped.m_AnimationCache.speed = 1.0f; + Ped.m_AnimationCache.progress = 0.0f; return true; } } } - - Ped.m_AnimationCache.startTime = GetTimestamp(); } else {