Added a more helpful error message when there is no current animation for the animation player
(cherry picked from commit 8bfeb9d6ae
)
This commit is contained in:
parent
9ec70c54ab
commit
11a07d071a
1 changed files with 2 additions and 2 deletions
|
@ -1362,13 +1362,13 @@ bool AnimationPlayer::is_valid() const {
|
||||||
|
|
||||||
float AnimationPlayer::get_current_animation_position() 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;
|
return playback.current.pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AnimationPlayer::get_current_animation_length() const {
|
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();
|
return playback.current.from->animation->get_length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue