From ee590e670d14c0928ba711fe30812cd213e21d82 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 27 Mar 2021 18:48:02 -0400 Subject: [PATCH] CFBStreamedPairOfTotals: Fix jumping to end of animation --- Runtime/Character/CFBStreamedAnimReader.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Runtime/Character/CFBStreamedAnimReader.cpp b/Runtime/Character/CFBStreamedAnimReader.cpp index 09f10a4da..c55c0e389 100644 --- a/Runtime/Character/CFBStreamedAnimReader.cpp +++ b/Runtime/Character/CFBStreamedAnimReader.cpp @@ -202,9 +202,9 @@ void CFBStreamedPairOfTotals::SetTime(CBitLevelLoader& loader, const CCharAnimTi prior = cur; priorTime = curTime; x78_t = 0.f; - } else + } else { x78_t = (time - priorTime) / (curTime - priorTime); - + } break; } ++cur; @@ -218,14 +218,21 @@ void CFBStreamedPairOfTotals::SetTime(CBitLevelLoader& loader, const CCharAnimTi loader.Reset(); } - if (next != -1) - while (u32(next) > Next().x1c_curKey) + if (prior != -1 && next == -1) { + next = cur; + } + if (next != -1) { + while (u32(next) > Next().x1c_curKey) { DoIncrement(loader); + } + } - if (!Prior().IsCalculated()) + if (!Prior().IsCalculated()) { Prior().CalculateDown(); - if (!Next().IsCalculated()) + } + if (!Next().IsCalculated()) { Next().CalculateDown(); + } } void CFBStreamedPairOfTotals::DoIncrement(CBitLevelLoader& loader) {