summaryrefslogtreecommitdiffstats
path: root/editor/gui/scene_tree_editor.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2024-01-24 14:08:20 +0100
committerYuri Sizov <yuris@humnom.net>2024-01-24 14:08:20 +0100
commitadcfe3d1a0fcb6313c656cbad09fec0ff48ad4a7 (patch)
tree17242502a5ec87f91c376aa56819234b1055eb44 /editor/gui/scene_tree_editor.cpp
parentea6e20253b1eb4e059a24fb588e55beb48d2e5cb (diff)
parent2f697926b0aac7fd59fd5bd0e496f0327dd98428 (diff)
downloadredot-engine-adcfe3d1a0fcb6313c656cbad09fec0ff48ad4a7.tar.gz
Merge pull request #87252 from ajreckof/Fix-renaming-a-node-to-the-name-of-its-siblings-breaking-NodePath
Fix renaming a node to the name of its siblings breaking NodePath
Diffstat (limited to 'editor/gui/scene_tree_editor.cpp')
-rw-r--r--editor/gui/scene_tree_editor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp
index 7a9df26fa7..8e90ec0194 100644
--- a/editor/gui/scene_tree_editor.cpp
+++ b/editor/gui/scene_tree_editor.cpp
@@ -1051,10 +1051,9 @@ void SceneTreeEditor::_rename_node(Node *p_node, const String &p_name) {
}
}
+ new_name = p_node->get_parent()->prevalidate_child_name(p_node, new_name);
if (new_name == p_node->get_name()) {
- if (item->get_text(0).is_empty()) {
- item->set_text(0, new_name);
- }
+ item->set_text(0, new_name);
return;
}