From ae9560af827fee8d232e997566775cbeb5a3287a Mon Sep 17 00:00:00 2001 From: jmb462 Date: Fri, 5 Nov 2021 21:51:42 +0100 Subject: Fix AnimatedSprite2D & 3D animation list in inspector --- scene/3d/sprite_3d.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scene/3d') diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 212d220ace..669c3eb7fd 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -1004,14 +1004,17 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &p_property) const { names.sort_custom(); bool current_found = false; + bool is_first_element = true; - for (List::Element *E = names.front(); E; E = E->next()) { - if (E->prev()) { + for (const StringName &E : names) { + if (!is_first_element) { p_property.hint_string += ","; + } else { + is_first_element = false; } - p_property.hint_string += String(E->get()); - if (animation == E->get()) { + p_property.hint_string += String(E); + if (animation == E) { current_found = true; } } -- cgit v1.2.3