ducking & anim fix

This commit is contained in:
eray orçunus 2020-06-20 20:26:27 +03:00
parent 2d2833f2e4
commit cc60ad1946
5 changed files with 53 additions and 30 deletions

View file

@ -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;