Make dict2inst set internal members of instance

Fix #2490
This commit is contained in:
George Marques 2015-09-20 16:17:30 -03:00
parent 889d21e004
commit 1d45c9a04c
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D

View file

@ -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); 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; } break;
case HASH: { case HASH: {