Merge pull request #47170 from hilfazer/print_stray_nodes

This commit is contained in:
Rémi Verschelde 2022-07-03 01:10:50 +02:00 committed by GitHub
commit 097556d11a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -2837,7 +2837,16 @@ static void _Node_debug_sn(Object *p_obj) {
} else {
path = String(p->get_name()) + "/" + p->get_path_to(n);
}
print_line(itos(p_obj->get_instance_id()) + " - Stray Node: " + path + " (Type: " + n->get_class() + ")");
String script_file_string;
if (!n->get_script().is_null()) {
Ref<Script> script = n->get_script();
if (script.is_valid()) {
script_file_string = ", Script: " + script->get_path();
}
}
print_line(itos(p_obj->get_instance_id()) + " - Stray Node: " + path + " (Type: " + n->get_class() + script_file_string + ")");
}
#endif // DEBUG_ENABLED