Skip to content

Commit

Permalink
Merge pull request #47170 from hilfazer/print_stray_nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Jul 2, 2022
2 parents 498334d + fe21fb1 commit 097556d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scene/main/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 097556d

Please sign in to comment.