From cc60ad1946794bfa8cc8ae86e62829035ff6f360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sat, 20 Jun 2020 20:26:27 +0300 Subject: ducking & anim fix --- src/animation/AnimBlendNode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/animation/AnimBlendNode.cpp') diff --git a/src/animation/AnimBlendNode.cpp b/src/animation/AnimBlendNode.cpp index 4186e994..860046e8 100644 --- a/src/animation/AnimBlendNode.cpp +++ b/src/animation/AnimBlendNode.cpp @@ -102,8 +102,8 @@ CAnimBlendNode::FindKeyFrame(float t) // advance until t is between frameB and frameA while(t > sequence->GetKeyFrame(frameA)->deltaTime){ t -= sequence->GetKeyFrame(frameA)->deltaTime; - frameB = frameA++; - if(frameA >= sequence->numFrames){ + frameA++; + if(frameA + 1 >= sequence->numFrames){ // reached end of animation if(!association->IsRepeating()){ CalcDeltas(); @@ -111,8 +111,8 @@ CAnimBlendNode::FindKeyFrame(float t) return false; } frameA = 0; - frameB = 0; } + frameB = frameA; } remainingTime = sequence->GetKeyFrame(frameA)->deltaTime - t; -- cgit v1.2.3