Merge pull request #42589 from Duroxxigar/add-animplayer-error-msg

Added more helpful error message for animation player
This commit is contained in:
Rémi Verschelde 2020-10-06 09:45:19 +02:00 committed by GitHub
commit 3a54fd94b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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();
}