Explorar el Código

Fix error when stopping empty animation player.

Check if animation exists before get section start time.

Signed-off-by: Ainsley Su <[email protected]>
Ainsley Su hace 1 año
padre
commit
baf0fb7e26
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      scene/animation/animation_player.cpp

+ 1 - 1
scene/animation/animation_player.cpp

@@ -777,7 +777,7 @@ void AnimationPlayer::_stop_internal(bool p_reset, bool p_keep_state) {
 	_clear_caches();
 	Playback &c = playback;
 	// c.blend.clear();
-	double start = get_section_start_time();
+	double start = c.current.from ? get_section_start_time() : 0;
 	if (p_reset) {
 		c.blend.clear();
 		if (p_keep_state) {