Skip to content

Commit c5904d9

Browse files
committed
Merge pull request #107690 from Meorge/bugfix/subtween-valid
Skip killed/invalid subtween
2 parents eea4227 + 914480e commit c5904d9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scene/animation/tween.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,14 @@ void SubtweenTweener::start() {
875875

876876
// Reset the subtween.
877877
subtween->stop();
878-
subtween->play();
878+
879+
// It's possible that a subtween could be killed before it is started;
880+
// if so, we just want to skip it entirely.
881+
if (subtween->is_valid()) {
882+
subtween->play();
883+
} else {
884+
_finish();
885+
}
879886
}
880887

881888
bool SubtweenTweener::step(double &r_delta) {

0 commit comments

Comments
 (0)