File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -6457,6 +6457,18 @@ void EditorNode::reload_instances_with_path_in_edited_scenes() {
64576457
64586458 get_scene_editor_data_for_node (owner, original_node, scene_editor_data_table);
64596459
6460+ // The current node being reloaded may also be an additional node for another node
6461+ // that is in the process of being reloaded.
6462+ // Replacing the additional node with the new one prevents a crash where nodes
6463+ // in 'addition_list' are removed from the scene tree and queued for deletion.
6464+ for (InstanceModificationsEntry &im : scene_modifications->instance_list ) {
6465+ for (AdditiveNodeEntry &additive_node_entry : im.addition_list ) {
6466+ if (additive_node_entry.node == original_node) {
6467+ additive_node_entry.node = instantiated_node;
6468+ }
6469+ }
6470+ }
6471+
64606472 bool original_node_scene_instance_load_placeholder = original_node->get_scene_instance_load_placeholder ();
64616473
64626474 // Delete all the remaining node children.
You can’t perform that action at this time.
0 commit comments