浏览代码

Validate AnimationNode name in AnimationStateMachine

Fixes #60959.
Valerii 3 年之前
父节点
当前提交
c28efd6c95
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/plugins/animation_state_machine_editor.cpp

+ 1 - 1
editor/plugins/animation_state_machine_editor.cpp

@@ -1018,7 +1018,7 @@ void AnimationNodeStateMachineEditor::_add_animation_type(int p_index) {
 
 	anim->set_animation(animations_to_add[p_index]);
 
-	String base_name = animations_to_add[p_index];
+	String base_name = animations_to_add[p_index].validate_node_name();
 	int base = 1;
 	String name = base_name;
 	while (state_machine->has_node(name)) {