summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuroxxigar <young9003@gmail.com>2020-10-06 01:21:23 -0400
committerDuroxxigar <young9003@gmail.com>2020-10-06 01:21:23 -0400
commit8bfeb9d6aeca9b71904babd9071317c4ae87f7fe (patch)
treeb3c8b0b1cd154560c5615675e1f5daf29991ce66
parent9b4399a50991de84c65b0b5f02d3ebb66c80b970 (diff)
Added a more helpful error message when there is no current animation for the animation player
-rw-r--r--scene/animation/animation_player.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 66c587e2d4..30757d2d80 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -1294,12 +1294,12 @@ 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();
}