diff options
Diffstat (limited to 'scene/3d/sprite_3d.cpp')
-rw-r--r-- | scene/3d/sprite_3d.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 50218a6d86..42460eec4c 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -132,7 +132,7 @@ void SpriteBase3D::draw_texture_rect(Ref<Texture2D> p_texture, Rect2 p_dst_rect, // Properly setup UVs for impostor textures (AtlasTexture). Ref<AtlasTexture> atlas_tex = p_texture; - if (atlas_tex != nullptr) { + if (atlas_tex.is_valid()) { src_tsize[0] = atlas_tex->get_atlas()->get_width(); src_tsize[1] = atlas_tex->get_atlas()->get_height(); } @@ -1324,7 +1324,7 @@ void AnimatedSprite3D::play(const StringName &p_name, float p_custom_scale, bool name = animation; } - ERR_FAIL_NULL_MSG(frames, vformat("There is no animation with name '%s'.", name)); + ERR_FAIL_COND_MSG(frames.is_null(), vformat("There is no animation with name '%s'.", name)); ERR_FAIL_COND_MSG(!frames->get_animation_names().has(name), vformat("There is no animation with name '%s'.", name)); if (frames->get_frame_count(name) == 0) { @@ -1402,7 +1402,7 @@ void AnimatedSprite3D::set_animation(const StringName &p_name) { emit_signal(SceneStringName(animation_changed)); - if (frames == nullptr) { + if (frames.is_null()) { animation = StringName(); stop(); ERR_FAIL_MSG(vformat("There is no animation with name '%s'.", p_name)); |