diff options
| author | Nikodem Lokatelj | 2018-03-30 14:49:21 +0200 |
|---|---|---|
| committer | Nikodem Lokatelj | 2018-03-30 14:49:21 +0200 |
| commit | 66d2cd3918134af4c9863d812ed960c586444897 (patch) | |
| tree | ed3022c6cd6c1ed593ec5bdfda43d4e8ddf53658 /editor/scene_tree_dock.cpp | |
| parent | 6eac0f6817b45814a0ba109539a13d3b6c893748 (diff) | |
| download | godot-66d2cd3918134af4c9863d812ed960c586444897.tar.gz godot-66d2cd3918134af4c9863d812ed960c586444897.tar.zst godot-66d2cd3918134af4c9863d812ed960c586444897.zip | |
perform_node_renames fix for a case where the new name is empty
Diffstat (limited to '')
| -rw-r--r-- | editor/scene_tree_dock.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index f86b00e17..37e06de96 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -933,7 +933,13 @@ void SceneTreeDock::perform_node_renames(Node *p_base, List<Pair<NodePath, NodeP NodePath root_path = p_base->get_path(); NodePath rel_path_old = root_path.rel_path_to(E->get().first); - NodePath rel_path_new = root_path.rel_path_to(E->get().second); + + NodePath rel_path_new = E->get().second; + + // if not empty, get new relative path + if (E->get().second != NodePath()) { + rel_path_new = root_path.rel_path_to(E->get().second); + } // if old path detected, then it needs to be replaced with the new one if (p == rel_path_old) { |
