[c][cpp] Fix for #1290, do not carry over time when timeScale of a track entry taht's being replaced by a new one is 0.

This commit is contained in:
badlogic 2019-03-04 17:04:03 +01:00
parent 57e38a0cb3
commit ed5dee43ef
2 changed files with 2 additions and 2 deletions

View File

@ -280,7 +280,7 @@ void spAnimationState_update (spAnimationState* self, float delta) {
float nextTime = current->trackLast - next->delay;
if (nextTime >= 0) {
next->delay = 0;
next->trackTime = (nextTime / current->timeScale + delta) * next->timeScale;
next->trackTime = current->timeScale == 0 ? 0 : (nextTime / current->timeScale + delta) * next->timeScale;
current->trackTime += currentDelta;
_spAnimationState_setCurrent(self, i, next, 1);
while (next->mixingFrom) {

View File

@ -334,7 +334,7 @@ void AnimationState::update(float delta) {
float nextTime = current._trackLast - next->_delay;
if (nextTime >= 0) {
next->_delay = 0;
next->_trackTime = (nextTime / current._timeScale + delta) * next->_timeScale;
next->_trackTime = current._timeScale == 0 ? 0 : (nextTime / current._timeScale + delta) * next->_timeScale;
current._trackTime += currentDelta;
setCurrent(i, next, true);
while (next->_mixingFrom != NULL) {