diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-18 08:25:04 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-08-18 08:26:41 -0300 |
commit | e61d547ed08924d75e18469fe648463dee3bd5a3 (patch) | |
tree | c620a2fee47e042f6199110d14f563a68e7c7d2f /scene/resources/packed_scene.cpp | |
parent | 1a92906b681735a5a2acfd98e3d6a4c75a7f6115 (diff) |
Make sure local to scene resources are initialized after loading all nodes, fixes #9438
Diffstat (limited to 'scene/resources/packed_scene.cpp')
-rw-r--r-- | scene/resources/packed_scene.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 169c956546..4dfc23fa67 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -242,7 +242,8 @@ Node *SceneState::instance(GenEditState p_edit_state) const { value = local_dupe; } - res->setup_local_to_scene(); + //this here may reference nodes not iniialized so this line is commented and used after loading all nodes + //res->setup_local_to_scene(); } //must make a copy, because this res is local to scene } @@ -293,6 +294,11 @@ Node *SceneState::instance(GenEditState p_edit_state) const { } } + for (Map<Ref<Resource>, Ref<Resource> >::Element *E = resources_local_to_scene.front(); E; E = E->next()) { + + E->get()->setup_local_to_scene(); + } + //do connections int cc = connections.size(); |