Explorar el Código

Merge pull request #107690 from Meorge/bugfix/subtween-valid

Skip killed/invalid subtween
Thaddeus Crews hace 1 mes
padre
commit
c5904d9f04
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      scene/animation/tween.cpp

+ 8 - 1
scene/animation/tween.cpp

@@ -875,7 +875,14 @@ void SubtweenTweener::start() {
 
 	// Reset the subtween.
 	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) {