Skip to content

Commit

Permalink
Fix SceneTreeDock invalid state after trying to remove internal Node
Browse files Browse the repository at this point in the history
  • Loading branch information
kleonc committed Aug 28, 2024
1 parent e439154 commit 6aad35a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2650,6 +2650,12 @@ void SceneTreeDock::_delete_confirm(bool p_cut) {
}
}

for (const Node *E : remove_list) {
// `move_child` + `get_index` doesn't really work for internal nodes.
ERR_FAIL_COND_MSG(E->get_internal_mode() != INTERNAL_MODE_DISABLED, "Trying to remove internal node, this is not supported.");
}
}

EditorNode::get_singleton()->hide_unused_editors(this);

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

unknown type name 'hide_unused_editors'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

C++ requires a type specifier for all declarations

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

invalid use of 'this' outside of a non-static member function

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

expected type-specifier before 'hide_unused_editors'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

expected constructor, destructor, or type conversion before 'hide_unused_editors'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

unknown type name 'hide_unused_editors'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

C++ requires a type specifier for all declarations

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

invalid use of 'this' outside of a non-static member function

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

missing return type after '->' ('int' assumed)

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

'hide_unused_editors': unknown override specifier

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

if a trailing return type is used then the leading return type shall be the single type-specifier 'auto' (not 'int')

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

missing type specifier - int assumed. Note: C++ does not support default-int

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

'int EditorNode::get_singleton(void)': overloaded function differs only by return type from 'EditorNode *EditorNode::get_singleton(void)'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

'EditorNode::get_singleton': 'int (void)' differs in levels of indirection from 'EditorNode *(void)'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

function 'EditorNode *EditorNode::get_singleton(void)' already has a body

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

syntax error: '('

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

syntax error: 'this'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

syntax error: ')'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

expected type-specifier before 'hide_unused_editors'

Check failure on line 2659 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

expected constructor, destructor, or type conversion before 'hide_unused_editors'

EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
Expand All @@ -2662,10 +2668,6 @@ void SceneTreeDock::_delete_confirm(bool p_cut) {
undo_redo->add_undo_method(scene_tree, "update_tree");
undo_redo->add_undo_reference(edited_scene);
} else {

Check failure on line 2670 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

expected unqualified-id

Check failure on line 2670 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

expected unqualified-id before 'else'

Check failure on line 2670 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

expected unqualified-id

Check failure on line 2670 in editor/scene_tree_dock.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

expected unqualified-id before 'else'
for (const Node *E : remove_list) {
// `move_child` + `get_index` doesn't really work for internal nodes.
ERR_FAIL_COND_MSG(E->get_internal_mode() != INTERNAL_MODE_DISABLED, "Trying to remove internal node, this is not supported.");
}
if (delete_tracks_checkbox->is_pressed() || p_cut) {
remove_list.sort_custom<Node::Comparator>(); // Sort nodes to keep positions.
HashMap<Node *, NodePath> path_renames;
Expand Down

0 comments on commit 6aad35a

Please sign in to comment.