From 6dd7d2c1f79eb2ac8f08785b9d903a01286184f8 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 12 Jan 2017 16:00:14 -0300 Subject: Implicit inheritance now defaults to Resource, will error for node scripts if extends not used. --- modules/gdscript/gd_compiler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/gdscript/gd_compiler.cpp') diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 7483af298..17a9c549b 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())); -- cgit v1.2.3-70-g09d2