diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-12 16:00:14 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-12 16:00:57 -0300 |
commit | 6dd7d2c1f79eb2ac8f08785b9d903a01286184f8 (patch) | |
tree | ca89e65b9566289437d02756350d06267932ad40 /modules/gdscript/gd_compiler.cpp | |
parent | 430f3e6043e806a350c82e054395b48367ecb8a7 (diff) | |
download | redot-engine-6dd7d2c1f79eb2ac8f08785b9d903a01286184f8.tar.gz |
Implicit inheritance now defaults to Resource, will error for node scripts if extends not used.
Diffstat (limited to 'modules/gdscript/gd_compiler.cpp')
-rw-r--r-- | modules/gdscript/gd_compiler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 7483af298c..17a9c549b4 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -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())); |