CFBStreamedPairOfTotals: Fix jumping to end of animation

This commit is contained in:
Luke Street 2021-03-27 18:48:02 -04:00
parent 02af2c32c0
commit ee590e670d
1 changed files with 13 additions and 6 deletions

View File

@ -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) {