Fix PackedScenes created with PackedScene.pack() have their exported nodes become null

This commit is contained in:
VolTer 2023-03-28 19:04:16 +02:00
parent 68b8156fe3
commit 6c6c1302f3
1 changed files with 9 additions and 10 deletions

View File

@ -263,17 +263,16 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
} }
} else { } else {
if (Engine::get_singleton()->is_editor_hint()) { node->set(PackedScene::META_POINTER_PROPERTY_BASE + String(prop_name), prop_variant);
// If editor, just set the metadata and be it.
node->set(PackedScene::META_POINTER_PROPERTY_BASE + String(prop_name), prop_variant); if (!Engine::get_singleton()->is_editor_hint()) {
continue; // If not editor, do an actual deferred sed of the property path.
DeferredNodePathProperties dnp;
dnp.path = prop_variant;
dnp.base = node;
dnp.property = prop_name;
deferred_node_paths.push_back(dnp);
} }
// Do an actual deferred sed of the property path.
DeferredNodePathProperties dnp;
dnp.path = prop_variant;
dnp.base = node;
dnp.property = prop_name;
deferred_node_paths.push_back(dnp);
} }
continue; continue;
} }