Browse Source

Skip killed/invalid subtween

Malcolm Anderson 1 month ago
parent
commit
914480e256
1 changed files with 8 additions and 1 deletions
  1. 8 1
      scene/animation/tween.cpp

+ 8 - 1
scene/animation/tween.cpp

@@ -875,7 +875,14 @@ void SubtweenTweener::start() {
 
 
 	// Reset the subtween.
 	// Reset the subtween.
 	subtween->stop();
 	subtween->stop();
-	subtween->play();
+
+	// It's possible that a subtween could be killed before it is started;
+	// if so, we just want to skip it entirely.
+	if (subtween->is_valid()) {
+		subtween->play();
+	} else {
+		_finish();
+	}
 }
 }
 
 
 bool SubtweenTweener::step(double &r_delta) {
 bool SubtweenTweener::step(double &r_delta) {