summaryrefslogtreecommitdiff
path: root/scene/resources/scene_format_text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/scene_format_text.cpp')
-rw-r--r--scene/resources/scene_format_text.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index ca85ca957a..2552f682fa 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -362,18 +362,15 @@ Error ResourceInteractiveLoaderText::poll() {
parent=packed_scene->get_state()->add_node_path(next_tag.fields["parent"]);
}
- if (next_tag.fields.has("owner")) {
- owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]);
- } else {
- if (parent!=-1)
- owner=0; //if no owner, owner is root
- }
if (next_tag.fields.has("type")) {
type=packed_scene->get_state()->add_name(next_tag.fields["type"]);
+ } else {
+ type=SceneState::TYPE_INSTANCED; //no type? assume this was instanced
}
+
if (next_tag.fields.has("instance")) {
instance=packed_scene->get_state()->add_value(next_tag.fields["instance"]);
@@ -384,6 +381,13 @@ Error ResourceInteractiveLoaderText::poll() {
}
}
+ if (next_tag.fields.has("owner")) {
+ owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]);
+ } else {
+ if (parent!=-1 && !(type==SceneState::TYPE_INSTANCED && instance==-1))
+ owner=0; //if no owner, owner is root
+ }
+
int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance);