summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-01-13 09:10:20 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-01-13 09:10:20 -0300
commit96317566c254223ab8a2055ee4e5bf22690e0072 (patch)
tree51dda8593247aac9941787ad8101a0d81be038ab /main/main.cpp
parent5fca2bd4bc66b246eb331adef01e11858ba80e3c (diff)
attempt another fix
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 149b3b775e..8736166b68 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1350,6 +1350,7 @@ bool Main::start() {
}
//second pass, load into global constants
+ List<Node*> to_add;
for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
String s = E->get().name;
@@ -1389,7 +1390,9 @@ bool Main::start() {
ERR_CONTINUE(!n);
n->set_name(name);
- sml->get_root()->add_child(n);
+ //defer so references are all valid on _ready()
+ //sml->get_root()->add_child(n);
+ to_add.push_back(n);
if (global_var) {
for(int i=0;i<ScriptServer::get_language_count();i++) {
@@ -1399,6 +1402,13 @@ bool Main::start() {
}
+ for(List<Node*>::Element *E=to_add.front();E;E=E->next()) {
+
+ sml->get_root()->add_child(E->get());
+ }
+
+
+
}
Node *scene=NULL;