1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Merge pull request #91341 from bjornmp/NewMaster

Enforce custom nodes to keep their original type
This commit is contained in:
Thaddeus Crews
2024-10-24 13:22:56 -05:00
10 changed files with 147 additions and 25 deletions

View File

@@ -4675,6 +4675,11 @@ void EditorNode::stop_child_process(OS::ProcessID p_pid) {
Ref<Script> EditorNode::get_object_custom_type_base(const Object *p_object) const {
ERR_FAIL_NULL_V(p_object, nullptr);
const Node *node = Object::cast_to<const Node>(p_object);
if (node && node->has_meta(SceneStringName(_custom_type_script))) {
return node->get_meta(SceneStringName(_custom_type_script));
}
Ref<Script> scr = p_object->get_script();
if (scr.is_valid()) {