Implicit inheritance now defaults to Resource, will error for node scripts if extends not used.
This commit is contained in:
parent
430f3e6043
commit
6dd7d2c1f7
|
@ -1729,9 +1729,14 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
|
|||
}
|
||||
|
||||
|
||||
}else {
|
||||
// without extends, implicitly extend Reference
|
||||
int native_idx = GDScriptLanguage::get_singleton()->get_global_map()["Reference"];
|
||||
native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx];
|
||||
ERR_FAIL_COND_V(native.is_null(), ERR_BUG);
|
||||
p_script->native=native;
|
||||
}
|
||||
|
||||
|
||||
//print_line("Script: "+p_script->get_path()+" indices: "+itos(p_script->member_indices.size()));
|
||||
|
||||
|
||||
|
|
|
@ -160,6 +160,8 @@ Variant GDScript::_new(const Variant** p_args,int p_argcount,Variant::CallError&
|
|||
_baseptr=_baseptr->_base;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_V(_baseptr->native.is_null(), Variant());
|
||||
|
||||
if (_baseptr->native.ptr()) {
|
||||
owner=_baseptr->native->instance();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue