diff options
Diffstat (limited to 'editor/rename_dialog.cpp')
-rw-r--r-- | editor/rename_dialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index e63b90c0ac..9fca334e7c 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -591,12 +591,12 @@ void RenameDialog::rename() { undo_redo->create_action(TTR("Batch Rename"), UndoRedo::MERGE_DISABLE, root_node, true); // Make sure to iterate reversed so that child nodes will find parents. - for (int i = to_rename.size() - 1; i >= 0; --i) { - Node *n = root_node->get_node(to_rename[i].first); - const String &new_name = to_rename[i].second; + for (List<Pair<NodePath, String>>::Element *E = to_rename.back(); E; E = E->prev()) { + Node *n = root_node->get_node(E->get().first); + const String &new_name = E->get().second; if (!n) { - ERR_PRINT("Skipping missing node: " + to_rename[i].first.get_concatenated_subnames()); + ERR_PRINT("Skipping missing node: " + E->get().first.get_concatenated_subnames()); continue; } scene_tree_editor->rename_node(n, new_name); |