You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Fix rename animation in SpriteFramesEditor/AnimationNodeStateMachineEditor
When the name suffix grows, the old name is used if it is obtained first. Fix the case where the following error message would appear when renaming an animation. ``` ERROR: Animation '' doesn't exist. at: get_frame_count (scene/resources/sprite_frames.cpp:71) ```
This commit is contained in:
@@ -1508,6 +1508,10 @@ void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) {
|
||||
int base = 1;
|
||||
String name = base_name;
|
||||
while (state_machine->has_node(name)) {
|
||||
if (name == prev_name) {
|
||||
name_edit_popup->hide(); // The old name wins, the name doesn't change, just hide the popup.
|
||||
return;
|
||||
}
|
||||
base++;
|
||||
name = base_name + " " + itos(base);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user