From 11a07d071a1590906da145fc766bdea5dbf6d465 Mon Sep 17 00:00:00 2001 From: Duroxxigar Date: Tue, 6 Oct 2020 01:21:23 -0400 Subject: [PATCH] Added a more helpful error message when there is no current animation for the animation player (cherry picked from commit 8bfeb9d6aeca9b71904babd9071317c4ae87f7fe) --- scene/animation/animation_player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 062678de4fc..ceaebb8d657 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1362,13 +1362,13 @@ bool AnimationPlayer::is_valid() const { float AnimationPlayer::get_current_animation_position() const { - ERR_FAIL_COND_V(!playback.current.from, 0); + ERR_FAIL_COND_V_MSG(!playback.current.from, 0, "AnimationPlayer has no current animation"); return playback.current.pos; } float AnimationPlayer::get_current_animation_length() const { - ERR_FAIL_COND_V(!playback.current.from, 0); + ERR_FAIL_COND_V_MSG(!playback.current.from, 0, "AnimationPlayer has no current animation"); return playback.current.from->animation->get_length(); }