From 17732fe698b835c29f77c84f329b2ed6cab215ce Mon Sep 17 00:00:00 2001 From: qarmin Date: Wed, 25 Sep 2019 10:28:50 +0200 Subject: Added some obvious errors explanations --- scene/2d/animated_sprite.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scene/2d/animated_sprite.h') diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index 2cc372bd93..3192d44678 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -85,7 +85,7 @@ public: _FORCE_INLINE_ Ref get_frame(const StringName &p_anim, int p_idx) const { const Map::Element *E = animations.find(p_anim); - ERR_FAIL_COND_V(!E, Ref()); + ERR_FAIL_COND_V_MSG(!E, Ref(), "Animation '" + String(p_anim) + "' doesn't exist."); ERR_FAIL_COND_V(p_idx < 0, Ref()); if (p_idx >= E->get().frames.size()) return Ref(); @@ -96,7 +96,7 @@ public: _FORCE_INLINE_ Ref get_normal_frame(const StringName &p_anim, int p_idx) const { const Map::Element *E = animations.find(p_anim); - ERR_FAIL_COND_V(!E, Ref()); + ERR_FAIL_COND_V_MSG(!E, Ref(), "Animation '" + String(p_anim) + "' doesn't exist."); ERR_FAIL_COND_V(p_idx < 0, Ref()); const Map::Element *EN = animations.find(E->get().normal_name); @@ -109,7 +109,7 @@ public: void set_frame(const StringName &p_anim, int p_idx, const Ref &p_frame) { Map::Element *E = animations.find(p_anim); - ERR_FAIL_COND(!E); + ERR_FAIL_COND_MSG(!E, "Animation '" + String(p_anim) + "' doesn't exist."); ERR_FAIL_COND(p_idx < 0); if (p_idx >= E->get().frames.size()) return; -- cgit v1.2.3