You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
make InstancePlaceholder in charge of node reference resolution
This commit is contained in:
@@ -314,6 +314,16 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
|
||||
ERR_FAIL_INDEX_V(nprops[j].value, prop_count, nullptr);
|
||||
|
||||
if (nprops[j].name & FLAG_PATH_PROPERTY_IS_NODE) {
|
||||
if (!Engine::get_singleton()->is_editor_hint() && node->get_scene_instance_load_placeholder()) {
|
||||
// We cannot know if the referenced nodes exist yet, so instead of deferring, we write the NodePaths directly.
|
||||
|
||||
uint32_t name_idx = nprops[j].name & (FLAG_PATH_PROPERTY_IS_NODE - 1);
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(name_idx, (uint32_t)sname_count, nullptr);
|
||||
|
||||
node->set(snames[name_idx], props[nprops[j].value], &valid);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t name_idx = nprops[j].name & (FLAG_PATH_PROPERTY_IS_NODE - 1);
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(name_idx, (uint32_t)sname_count, nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user