Skip to content

Commit

Permalink
Merge pull request #75429 from MewPurPur/Literally-cant-have-a-functi…
Browse files Browse the repository at this point in the history
…oning-level-editor-because-of-this-please-helppp

Fix PackedScenes created with PackedScene.pack() have their exported nodes become null
  • Loading branch information
akien-mga committed Apr 25, 2023
2 parents 15d9521 + 6c6c130 commit ed62d96
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions scene/resources/packed_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,16 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
}

} else {
if (Engine::get_singleton()->is_editor_hint()) {
// If editor, just set the metadata and be it.
node->set(PackedScene::META_POINTER_PROPERTY_BASE + String(prop_name), prop_variant);
continue;
node->set(PackedScene::META_POINTER_PROPERTY_BASE + String(prop_name), prop_variant);

if (!Engine::get_singleton()->is_editor_hint()) {
// 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;
}
Expand Down

0 comments on commit ed62d96

Please sign in to comment.