diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-10-19 18:48:34 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-10-19 18:48:34 -0300 |
commit | 2b12a8109dda1f47f9b75a5de91d7d00c1f25869 (patch) | |
tree | 3f3775c304e76ea2776d336c9a471d99359872c0 /modules/gdscript/gd_functions.cpp | |
parent | 5d86a25f4d04b21559f0d4edbd4e70dc01ea6685 (diff) | |
parent | 0a02c28b2be8e8271d5f3ffb95a4b09f91c3bd32 (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'modules/gdscript/gd_functions.cpp')
-rw-r--r-- | modules/gdscript/gd_functions.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index 37ddb2bc41..6f51ac5312 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -904,6 +904,15 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va r_ret = gdscr->_new(NULL,0,r_error); + GDInstance *ins = static_cast<GDInstance*>(static_cast<Object*>(r_ret)->get_script_instance()); + Ref<GDScript> gd_ref = ins->get_script(); + + for(Map<StringName,GDScript::MemberInfo>::Element *E = gd_ref->member_indices.front(); E; E = E->next()) { + if(d.has(E->key())) { + ins->members[E->get().index] = d[E->key()]; + } + } + } break; case HASH: { |